LocalAI CLI Cheatsheet - local-ai Self-hosted Inference Server Full Reference
LocalAI is an open-source, self-hosted OpenAI-compatible inference server for LLM, embeddings, and audio that runs on CPU without a GPU. local-ai is its unified CLI: run and serve start the server, models manage weights, api exposes standard endpoints. This sheet covers launch, model management, and calls so you can self-host a private AI backend.
Start Server 6
local-ai runlocal-ai servedocker run -p 8080:8080 localai/localailocal-ai startlocal-ai --helplocal-ai serve --models-path ./modelsModel Management 7
local-ai models listlocal-ai models install gpt4alllocal-ai models pull gpt4alllocal-ai models install llama-3-instructlocal-ai models applylocal-ai models list --helplocal-ai models install --helpAPI and Finetune 7
local-ai apicurl http://localhost:8080/v1/chat/completions -d '{"model":"gpt4all","messages":[{"role":"user","content":"hi"}]}'curl http://localhost:8080/v1/modelslocal-ai finetunelocal-ai api --helpcurl http://localhost:8080/v1/embeddings -d '{"input":"text"}'local-ai models apply --helpTips
- LocalAI is OpenAI-compatible; point an existing project base_url at port 8080 to go private.
- It runs without a GPU: smaller quantized models still give basic completion on CPU.
- models install pulls from the gallery; put custom weights in --models-path for easier management.
FAQ
How to choose between LocalAI and Ollama?
LocalAI focuses on OpenAI-compatible self-hosting (with embeddings and audio) and richer config; Ollama is lighter and quicker to start. Both run local models.
Can it run without a GPU?
Yes. LocalAI supports pure CPU inference, slower but workable with small quantized models.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Sep 10, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us