LocalAI CLI Cheatsheet - local-ai Self-hosted Inference Server Full Reference
Plenty of teams want to keep using the OpenAI SDK without shipping code off the network, and LocalAI is the swap-in path: point base_url at localhost and models, embeddings, and speech all stay on your own machine. This table groups service startup, model management, and API and fine-tuning, explaining the difference between run and serve under the local-ai entry point, how the models subcommands install and list what you have, and how the fine-tuning endpoints are called. The deciding variable is the match between hardware and model size: whether it runs without a GPU depends on parameter count and quantization level, not on LocalAI itself, so validate the whole chain with a few-hundred-megabyte quantized model before attempting anything larger. Reach for it when compliance requires data to stay inside the network, when a development environment must reproduce a model behavior offline, or when routing between a small local model and a large hosted one. Against GPU-only serving stacks such as vLLM, it behaves more like a local AI gateway with model management and multimodal support built in.
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