Overview
The Allternit Local Engine is a self-hosted service that downloads model weights (through Freeweights, falling back to the Hugging Face Hub), keeps them in a local cache, and manages the lifecycle of local inference backends. It exposes a small HTTP API for model download/import, runtime launch/stop, hardware status, and a/v1/chat/completions proxy that routes requests to a healthy backend serving the requested model.
Models, runtime logs, and inference traffic stay on the host. Nothing is sent to Allternit-managed inference endpoints unless you explicitly route traffic through them.
Base URL
Local development (default):What it does
- Model cache — tracks downloaded and imported models with their byte-level progress, status, and local paths.
- Verified downloads — every file is fetched through the model source contract: Freeweights first, then the publisher (Hugging Face), checked by sha256 or the git blob id. Partial downloads resume. Each model in
GET /modelscarries averificationstate, andPOST /models/verifyre-hashes the files on disk. Data with no hash is refused unless the request setsallow_unverified. SetALLTERNIT_FREEWEIGHTS_URLto point at a different Freeweights base. See Freeweights. - Local imports — registers models already on disk, including exports produced by Studio training jobs.
- Runtime manager — spawns inference backends on a free port, polls their health endpoint, and captures logs.
- Chat proxy — forwards
/v1/chat/completionsrequests to the correct healthy runtime using themodelfield. - Host diagnostics — reports CPU, RAM, disk, and GPU information so clients can pick compatible models.
Installation
The Local Engine is a Rust binary in the Allternit workspace.Requirements
- Rust toolchain (workspace edition 2021)
- Engines come as engine packs: llama.cpp, MLX (Apple Silicon Macs only) and colibri. You do not put anything on
PATH. The engine downloads the pack for your computer the first time a model needs it, checks it, and keeps it under its data directory. A computer with no pack gets a plain message saying so. - Sufficient disk space under the OS data directory for cached models
{data_dir} is dirs::data_dir() on your platform (for example, ~/Library/Application Support on macOS or ~/.local/share on Linux).
Endpoints
Model cache
Every cached model has a stable local ID derived from the source repo, revision, and optional quantization suffix:meta-llama/Llama-2-7b-hf at main becomes:
Model status values
List cached models
Download a model
/models to watch downloaded_bytes and status. The engine filters the Hugging Face tree to keep only config/tokenizer files and weight files (.safetensors, .bin, .gguf, .mlx, .pt, .pth), while skipping READMEs, images, and metadata files. Partial .part files are resumed when possible.
Import a local model
Use this for weights already on disk or for Studio training exports.source can be local_path or unsloth_output. The path must be a directory.
Launch a runtime
A recipe tells the engine which backend to spawn and how to configure it.127.0.0.1, spawns the backend, and polls its /health endpoint for up to 30 seconds. Once healthy, status becomes running. Logs are written to {data_dir}/allternit-local-engine/logs/runtimes/{runtime_id}.log.
Supported backends
The recipe schema supports four backends. Today,llama_cpp is fully implemented; the others are reserved for future releases.
Recipe fields for llama.cpp
List and stop runtimes
List runtimes
Stop a runtime
Chat completions proxy
Once a runtime isrunning, send chat completion requests through the Local Engine. The proxy reads the model field, finds a healthy runtime serving that model ID, and forwards the request to the backend.
/v1/chat/completions schema.
Service status and diagnostics
system_profiler on macOS, nvidia-smi on Linux, and on Windows nvidia-smi for NVIDIA cards, then the WMI adapter list (Win32_VideoController) for AMD/Intel. WMI can’t report VRAM of 4 GB or more, so those cards show no memory figure. On Apple Silicon, GPU memory is reported as shared system memory.