Overview
The Allternit Local Engine is a self-hosted service that downloads model weights from 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.
- Hugging Face downloads — verifies the repo, filters out non-essential files, resumes partial downloads, and validates safe filesystem paths.
- Local imports — registers models already on disk, including exports produced by Unsloth 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)
- For the
llama.cppbackend,llama-servermust be onPATH - 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 Unsloth 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 and nvidia-smi on Linux. On Apple Silicon, GPU memory is reported as shared system memory.