The web UI is not the only way to talk to a LocalAI model: the local-ai command line has a chat mode, and the project also ships a terminal agent. For a quick question or a script, the terminal is faster than the browser.
Chat from the terminal
Run local-ai chat --model <model-name> in the terminal, with the model name as LocalAI knows it — for example the gallery name you installed, or a huggingface:// path. The command opens a chat session in the terminal: type a message, read the reply, and keep going. The project also documents a terminal agent mode for the same command line, for agentic use from the terminal.
local-ai chat --model gemma-4-e2b-it-qat-q4_0
# or: local-ai run <gallery-name>
# or: local-ai run huggingface://<user>/<model>
The terminal chat uses the same server and the same models as the web UI, so a model that works in one works in the other. If the chat says the model is missing, download it first — local-ai models list shows what is installed.
Try it: four checks
| Check | What you should see | If you do not see it |
|---|---|---|
| Model installed | The model is downloaded | Check local-ai models list |
| Chat starts | local-ai chat opens a session | Check the model name |
| Reply returns | The model answers in the terminal | Try a simple question first |
| Session ends | Exiting the chat ends the session | That is expected |
Expected result. We checked the LocalAI quickstart, which documents local-ai chat –model, local-ai run with a gallery name, huggingface:// and ollama:// paths, and local-ai models list. We did not run the command on this machine.
Limits
This guide covers the terminal chat only. The terminal agent mode is a separate feature. We did not test any command ourselves.
