New Tool Radar

Local AI

How to Chat Interactively in the Terminal with llama-cli

Start an interactive llama-cli chat with a GGUF model and keep the conversation going.

Schematic illustration with three step boxes: Get a model file; Start the chat; Use conversation mode.

llama-cli is the command-line chat tool in llama.cpp: it loads a GGUF model and gives you a prompt in the terminal, with no server and no browser. This guide starts an interactive chat, keeps the conversation in context, and ends it cleanly.

Before you start

  • llama.cpp installed, with llama-cli on your PATH.
  • A GGUF chat model file, for example a Qwen3 8B Q4_K_M file.
  • A terminal.

Start the chat

Launch the chat with the model file:

llama-cli -m qwen3-8b-q4_k_m.gguf -p "You are a helpful assistant."

The model loads, then shows a prompt where you can type. The first load takes a while; later prompts are faster.

Keep the conversation in context

Use conversation mode so follow-up questions remember earlier turns:

llama-cli -m qwen3-8b-q4_k_m.gguf -cnv -p "You are a helpful assistant."

With -cnv, each new message is added to the context, so you can say “and what about the second one?” and the model knows what you mean.

End the chat

Press Ctrl+C to stop the chat, or type /exit if the build supports it. The model is unloaded when the process ends.

Worked example

Worked example: ask “What is the capital of Norway?” and then “How many people live there?” In conversation mode the second answer should be about Oslo, because the model remembers the first turn. Without -cnv, the second question has no context and the answer is likely to ask which city you mean.

Expected result

UNTESTED in this guide: no chat was run while writing it. The expected result is that llama-cli loads the model, answers the first question, and in conversation mode answers the follow-up about Oslo.

Limitations

The terminal chat has no web interface, no history file by default, and no multi-user support. For a shared or browser-based chat, use llama-server or a chat app instead.

Sources

See all