Overview
The Local Engine API is a thin, authenticated proxy to the Allternit Local Engine controller (services/local-engine). All routes are mounted under /api/local-engine and forward request bodies and responses verbatim, so the gateway never becomes a second source of model or runtime state.
Use this surface to:
- Inspect the health and host status of the local engine.
- Manage cached models: list, import from disk, and queue downloads from Hugging Face.
- Launch and stop local model runtimes.
- Call a running local model through a chat-completions-compatible surface.
Base URL
Production:LOCAL_ENGINE_URL, defaulting to http://127.0.0.1:3015.
Authentication
All routes require a valid bearer token in theAuthorization header. Requests without a recognized user receive 401 Unauthorized. See Authentication for details.
Endpoints
Health
Example request
Example response
Status
Example response
List models
Example response
Model object fields
Import a model
Request body
Example request
Example response
Download a model
Request body
Example request
Example response
List runtimes
Example response
Runtime object fields
Launch a runtime
GET /api/local-engine/runtimes to wait for status: "running".
Request body
Recipe variants
Therecipe object is a tagged union keyed by backend.
Example request
Example response
Stop a runtime
status: "stopped".
Path parameters
Example request
Example response
Chat-completions models list
Example response
Chat completions
model. Both non-streaming and streaming (stream: true) requests are supported; streaming responses are returned as server-sent events.
The request body is forwarded verbatim, so all standard chat-completions options—temperature, max_tokens, tools, response_format, and stream—are supported when the underlying backend accepts them.
Request body
Example request
Example response
Streaming example
Setstream: true and Accept: text/event-stream to receive incremental deltas:
Error codes
Upstream status codes and response bodies are forwarded transparently whenever possible, so a
400 from the controller is returned as a 400 to the caller.
Related pages
- Local Brains API — Ollama-based local memory and sidecar models
- Models — gateway model catalog and policy aliases
- Chat Completions — hosted gateway chat-completions surface
- Runtime Backend API — configure local, BYOC, and remote runtimes
- Runtime Discovery API — probe local runtime instances
- Authentication — virtual keys and bearer tokens