# LocalAI > LocalAI is the open-source, self-hosted AI inference engine that acts as a drop-in replacement for the > OpenAI and Anthropic REST APIs. One MIT-licensed Go binary or container exposes 123 HTTP operations > across chat, completions, embeddings, images, video, 3D, speech-to-text, text-to-speech, audio > classification and diarization, object detection, depth, reranking, moderation, tokenization, and face > and voice recognition — running locally on CPU or GPU with no external API calls and no data leaving > the host. Provenance: GENERATED by the API Evangelist enrichment pipeline on 2026-08-27 from the provider's own published artifacts. LocalAI serves no /llms.txt of its own (https://localai.io/llms.txt returned 404, probed 2026-08-27). Every URL below was fetched and returned 200 unless marked otherwise. ## What an agent needs to know first - LocalAI is SELF-HOSTED. There is no vendor-operated API endpoint, no hosted base URL, no account, no API key you can obtain from the vendor, and no pricing. The base URL is the address of an instance the operator runs; the documented default is http://localhost:8080. - The contract is Swagger 2.0, generated from Go source and published in the repository. It declares NO operationId on any of its 123 operations, so operations must be addressed as "METHOD path". - Since v4.9.0 authentication is DENY-BY-DEFAULT: when either auth mode is configured, every route needs credentials except a published anonymous discovery/bootstrap list. - Three anonymous endpoints let an agent orient itself against a live instance before authenticating: GET /.well-known/localai.json, GET /api/instructions, GET /api/instructions/{name}. - There are no rate limits, no idempotency keys and no RFC 9457 problem details. Pagination exists on only 3 of 123 operations (GET /api/traces, /api/backend-traces, /api/agent/jobs); every resource collection returns an unbounded list. - Error envelopes differ by endpoint family: OpenAI-shaped, Anthropic-shaped on /v1/messages, and Open-Responses-shaped on /v1/responses. Pick the parser by endpoint, not by content type. ## Contract - [OpenAPI / Swagger 2.0 (verbatim)](https://raw.githubusercontent.com/mudler/LocalAI/master/swagger/swagger.json): 114 paths, 123 operations, 166 definitions. - [Interactive reference](https://localai.io/docs/reference/) - Swagger UI on any instance: /swagger/index.html — anonymous even when auth is configured. ## gRPC backend contract LocalAI publishes a second, first-party contract: `backend/backend.proto` (proto3, service `backend.Backend`, 52 RPCs, 19 of them streaming, 114 messages). It is the interface every LocalAI inference backend implements — the contract you write against to ADD an engine, not to call one. It also covers capability absent from REST: fine-tuning (StartFineTune, FineTuneProgress, ListCheckpoints, ExportModel), quantization, distributed Forward, and bidirectional live audio streams. - [backend.proto](https://raw.githubusercontent.com/mudler/LocalAI/master/backend/backend.proto) ## Documentation - [Documentation home](https://localai.io/docs/) - [Install](https://localai.io/installation/): container (recommended), macOS DMG, Linux binary, Kubernetes Helm chart, source. - [Getting started](https://localai.io/basics/getting_started/) - [Authentication & authorization](https://localai.io/features/authentication) - [API error reference](https://localai.io/reference/api-errors) - [Runtime error reference](https://localai.io/reference/runtime-errors) - [CLI reference](https://localai.io/reference/cli-reference) - [API discovery & instructions](https://localai.io/docs/features/api-discovery/) - [Model Context Protocol](https://localai.io/features/mcp) - [LocalAI Assistant (admin MCP server)](https://localai.io/features/localai-assistant) - [Realtime API](https://localai.io/features/openai-realtime) - [Middleware: PII filtering and intelligent routing](https://localai.io/features/middleware/) - [Tracing](https://localai.io/features/tracing) - [Advanced](https://localai.io/advanced/) ## Inference endpoints (OpenAI-compatible) - POST /v1/chat/completions — chat; supports stream and metadata.mcp_servers - POST /v1/completions - POST /v1/embeddings - POST /v1/responses, GET /v1/responses/{id}, POST /v1/responses/{id}/cancel - POST /v1/messages — Anthropic Messages compatible - POST /v1/images/generations, /v1/images/inpainting, /v1/images/upscale - POST /v1/audio/transcriptions, /v1/audio/speech, /v1/audio/classification, /v1/audio/diarization - POST /v1/text-to-speech/{voice-id}, /v1/sound-generation — ElevenLabs compatible - POST /v1/moderations, /v1/rerank, /v1/tokenize, /v1/detokenize - POST /v1/detection, /v1/depth, /video, /vad, /tts - POST /3d/generations, /3d/remesh - GET /v1/models, GET /v1/models/capabilities - WebSocket /v1/realtime?model=; WebRTC via POST /v1/realtime ## Management endpoints (admin) - Models: GET /models/available, /models/galleries, POST /models/apply, /models/delete/{name}, GET /models/jobs/{uuid}, PUT /api/models/{name}/{action}, PATCH /api/models/config-json/{name}, POST /api/models/vram-estimate - Backends: GET /backends, /backends/available, /backends/known, POST /backends/apply, /backends/upgrade/{name}, /backends/delete/{name} - Agents: /api/agent/tasks, /api/agent/jobs, /api/agent/jobs/{id}/cancel - Middleware: POST /api/pii/analyze, /api/pii/redact, POST /api/router/decide, /api/router/{name}/corpus - Observability: GET /system, /metrics, /api/traces, /api/backend-traces, /api/backend-logs/{modelId}, WebSocket /ws/backend-logs/{modelId} - P2P: GET /api/p2p, /api/p2p/token, /api/nodes/models ## MCP LocalAI is both an MCP HOST and an MCP SERVER. - As a host it connects models and agents to remote HTTP and local stdio MCP servers and executes their tools server-side inside the completion loop, across /v1/chat/completions, /v1/messages and /v1/responses. Select servers per request with metadata.mcp_servers. - As a server it ships `local-ai mcp-server --target --api-key `, a STDIO server (there is no hosted remote endpoint) exposing a 25-tool admin catalog. `--read-only` drops every mutating tool. ## Source, licence and security - [Repository](https://github.com/mudler/LocalAI) — MIT, 48,703 stars, current release v4.9.0 (2026-08-20) - [Releases](https://github.com/mudler/LocalAI/releases) - [Security policy](https://github.com/mudler/LocalAI/blob/master/SECURITY.md) — report to security@localai.io, 48-hour acknowledgement target, no monetary bounty, recognition via Huntr - [Discussions / support](https://github.com/mudler/LocalAI/discussions) - [Blog](https://localai.io/blog/) - [Agent Hub](https://agenthub.localai.io) — free gallery of ready-made agent configurations ## Known gaps (measured, not inferred) - No /llms.txt, no /.well-known/* document and no A2A agent card on any vendor host (all 404). - No operationIds; info.version says 2.0.0 while the software is v4.9.0. - At least seven documented endpoints are missing from the contract, including /api/pii/events, /api/middleware/status, /api/router/decisions and /models/reload. - The Helm chart is at 3.4.2 / appVersion 2.23 (2024-11-21) against a v4.9.0 server. - proxy.golang.org resolves the Go module to v1.40.0 (2023-10-30) because the repository never adopted a /vN module path, so Go library consumers cannot import anything newer by tag. - The published supported-versions table stops at 3.x and does not name the shipping 4.x series.