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.

AI CLI·20 commands·Last updated 2026-09-10

Start Server 6

local-ai run
Start with default config
local-ai serve
Start the API server (same as run)
docker run -p 8080:8080 localai/localai
Run via Docker
local-ai start
Start resources from a file
local-ai --help
List all commands
local-ai serve --models-path ./models
Start with a custom model dir

Model Management 7

local-ai models list
List installed models
local-ai models install gpt4all
Install a gallery model
local-ai models pull gpt4all
Pull a model from the repo
local-ai models install llama-3-instruct
Install a named model
local-ai models apply
Apply model configuration
local-ai models list --help
models subcommand help
local-ai models install --help
Install flags

API and Finetune 7

local-ai api
Start the API service
curl http://localhost:8080/v1/chat/completions -d '{"model":"gpt4all","messages":[{"role":"user","content":"hi"}]}'
Call chat completions
curl http://localhost:8080/v1/models
List available models
local-ai finetune
Start a finetune job
local-ai api --help
api help
curl http://localhost:8080/v1/embeddings -d '{"input":"text"}'
Call embeddings
local-ai models apply --help
apply help

Tips

  • 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