HTTP API

The LlamaForge dashboard backend (backend/server.py) listens on panel_port (default 8090) and serves the web UI, the /api/* management API, and two agent-facing, provider-compatible chat endpoints. All routes below are read directly from do_GET/do_POST in backend/server.py.

/api/* request/response bodies are JSON. Every JSON response has Cache-Control: no-store.

If vLLM support isn't available on the host, every route is first checked by _vllm_gate(); requests to /api/vllm/* paths return an error response instead of reaching the normal handler.

Agent-facing endpoints

These are the endpoints external coding agents (Claude Code, Codex, etc.) talk to — see backend/agentsetup.py for the config generators that point agents at them.

MethodPathPurpose
POST/v1/messagesAnthropic Messages API-compatible endpoint. Requires anthropic_shim_enabled: true in config.json (the default) and uses conditional _shim_auth_ok: auth is skipped for local router scope (and current behavior also skips when no key is configured); when enforced, it accepts either x-api-key or Authorization: Bearer <key>. Supports "stream": true (SSE) via _anthropic_stream, translates to the OpenAI-shaped request, and forwards to the router.
POST/v1/messages/count_tokensAnthropic-compatible token-count estimate for a would-be /v1/messages request. Same enable and conditional auth behavior as /v1/messages.
POST/v1/chat/completionsOpenAI Chat Completions-compatible endpoint with the same conditional _shim_auth_ok behavior. Injects the active wiki context profile as a system message (_inject_openai_system) before forwarding to the router. Supports "stream": true.
POST/api/loadLoad a model into the router. Body: {"model": "<id>"}. Proxies to the router's /models/load.
POST/api/unloadUnload a model from the router. Body: {"model": "<id>"}. Proxies to the router's /models/unload.
POST/api/unload_allUnload every currently loaded/loading model (except the router's default entry).

Model and preset management

MethodPathPurpose
GET/api/stateDashboard state: models (llama.cpp + vLLM merged), GPU telemetry, platform, public config projection, and onboarding status. config is an exact allowlist (theme, cvd, auto_load_model, vram_bandwidths, presets, preset_bindings, active_engine) plus router_api_key_configured; it is not full config.json and never includes the key.
GET/api/schemaThe knob schema (available llama-server flags), built from llama-server --help.
POST/api/saveSave per-model knob overrides into models.ini (config.set_keys). Reloads the running model if it was loaded.
POST/api/models/unregisterRemove a llama-family model from its models.ini registry without deleting the GGUF. Body: {model, backend}. Unloads it first when necessary.
GET/api/presetsList saved knob presets from config.json.
POST/api/presets/saveSave a named knob preset.
POST/api/presets/deleteDelete a named preset.
POST/api/presets/applyApply a saved preset's knobs to a model, same reload behavior as /api/save.
POST/api/presets/bindBind a preset as a model's default (materializes its knobs; name: "" unbinds). Re-saving a bound preset re-syncs every model using it.
GET/api/model/metadataGGUF metadata for a model id (query param model).
GET/api/model/diagDiagnostic read of the router log against a model's merged ([*] + per-model) settings (query param model).
POST/api/autotune/recommendRecommend knob values for a model given hardware constraints. Body: {model, intent} where intent is balanced, speed, context, or coding. Returns {knobs, reasons}.
POST/api/autotune/refineAuto-generate knob recommendations, benchmark candidates with real completion requests (~200 tokens), and return the fastest config. Body: {model, intent} (knobs optional; generated if omitted). Returns {knobs, measurements: {candidates: [{knobs, tok_s}], chosen_tok_s}}.
GET/api/scan/missingList models.ini entries whose GGUF file no longer exists on disk.
POST/api/scanScan directories for GGUF files. Body roots overrides saved model_dirs; explicit roots: [] selects platform defaults.
POST/api/scan/applyRegister scanned entries into models.ini and reapply ctx-size defaults.
POST/api/scan/pruneRemove models.ini sections whose file is missing (unloading first if loaded).

Build, setup, and hardware

MethodPathPurpose
GET/api/setupPrerequisite tool status (git/cmake/ninja/compiler/CUDA) plus hardware recommendation.
POST/api/setup/installInstall a missing prerequisite tool (Windows/macOS only).
GET/api/gpusGPU telemetry via a shared 10-second nvidia-smi cache.
GET/api/build/infoCurrent commit, available updates, and recommended/saved CMake flags (per target: llamacpp or ikllama).
GET/api/build/logTail of the build log plus builder state (phase includes done_warnings for a partial success).
POST/api/build/startStart (re)building the target engine with the given (or saved/recommended) CMake flags.
POST/api/engine/switchPoint the router at llamacpp or ikllama (sets active_engine); refused if the target binary has no router mode.

VRAM prediction

MethodPathPurpose
GET/api/vram/predictPredict whether a model quant will fit your GPU and at what approximate speed. Query params: repo (HF repo id), quant (e.g. Q4_K_M). Returns {regime, tok_s, model_size_bytes, active_size_bytes}. Factors in MoE active-vs-total parameters and GPU memory bandwidth (with Setup overrides).

Model Hub (download)

MethodPathPurpose
POST/api/hub/searchSearch Hugging Face for GGUF repos, annotated with what's already installed.
POST/api/hub/filesList a repo's files/quantizations, sized against available VRAM.
POST/api/hub/downloadStart downloading a model (and optional mmproj) from the Hub.
GET/api/hub/progressCurrent download progress.
POST/api/hub/cancel / /api/hub/pause / /api/hub/resumeControl the active download.
POST/api/hub/addRegister a finished manual/download-dir GGUF into models.ini.

Network and router control

MethodPathPurpose
GET/api/networkRedacted Network Access status: canonical/legacy access scope, configured host and security/key status, key-present boolean, remediation message, configured port and LAN IP, plus router_running/listener_status. A listening port is observation only, not process-identity or authentication verification.
POST/api/networkSave a canonical Network Access request and restart the router. Body: `{access_scope: "local""lan", key_action: "keep""generate""replace""clear", api_key?: "..."}. replace requires a strong replacement; clear is local-only; LAN has no unauthenticated path. For one release, the old {host, api_key} shape is accepted only for canonical hosts. A generated key is returned only as generated_api_key to that explicit request. Results distinguish saved configuration from restart_status (running, starting, or failed`) and listener observation.
POST/api/client/configDeliberately generate client snippets for {model, backend}. llama-family output may contain the router key; active vLLM output does not. Unknown, ambiguous, or unloaded vLLM targets are rejected.
GET/api/router/logTail of the router's log.
GET/api/statsUsage stats summary.
POST/api/stats/resetReset usage stats.
POST/api/configMerge the request body into config.json and save.

There is no GET /api/config route; current config is read via GET /api/state's config field instead.

vLLM (WSL) management

Only reachable when vLLM support is available on the host (_vllm_gate).

MethodPathPurpose
GET/api/vllm/setupvLLM/WSL install status plus any running setup job.
POST/api/vllm/setup/installKick off the vLLM install script inside WSL.
POST/api/vllm/updateRun the vLLM update script inside WSL.
GET/api/vllm/logTail of the vLLM process log.
GET/api/vllm/schemavLLM knob schema.
GET/api/vllm/versionInstalled vs. latest PyPI vLLM version.
POST/api/vllm/load / /api/vllm/unloadLoad/unload a registered vLLM model.
POST/api/vllm/saveSave a vLLM model's settings, restarting it if currently running.
POST/api/vllm/hub/searchSearch Hugging Face for vLLM-servable repos.
POST/api/vllm/hub/infoRepo info sized against available VRAM.
POST/api/vllm/hub/downloadStart a vLLM model download.
GET/api/vllm/hub/progressDownload progress.
POST/api/vllm/hub/registerRegister a downloaded model into the vLLM registry.
POST/api/vllm/deleteDelete a downloaded vLLM model and deregister it.

Agent config and context wiki

MethodPathPurpose
POST/api/agent/configDeliberately preview connection config for {agent, model, backend, small, inject}. It is POST-only; the active llama-family backend is required and vLLM is rejected.
POST/api/agent/applyWrite agent config on the dashboard machine using the same targeting fields (agent, model, backend, small, inject). It may use the stored key internally but never returns a key.
GET/api/wiki/docsList context-wiki documents.
GET/api/wiki/docRead a single document (query param name).
POST/api/wiki/docCreate/update a document.
POST/api/wiki/doc/deleteDelete a document.
GET/api/wiki/profilesList saved context profiles.
POST/api/wiki/profileSave a named profile (its doc list + description).
POST/api/wiki/profile/deleteDelete a profile.
GET/api/wiki/previewPreview the composed text for a profile (query param profile).
POST/api/wiki/activeSet the active profile for a model.
POST/api/wiki/exportExport composed context (e.g. to an agent's own file format).

Docs viewer

MethodPathPurpose
GET/api/docsManifest of documentation pages (sections/order/titles).
GET/api/docs/pageRendered HTML for one page (query param slug); 404 if the slug doesn't exist.
GET/docs/img/<name>Serve an image referenced from a docs page, path-safety-checked by docs._safe_img.

Static / UI

MethodPathPurpose
GET/ or /index.htmlThe dashboard's single HTML page.
GET/web/js/<name>.jsA frontend ES module. Confined to web/; anything outside 404s.

Engine-agnostic model verbs

These dispatch on the model's own backend, so the same call works for a llama.cpp GGUF and a vLLM safetensors repo. The body takes an optional backend hint ("llamacpp" / "vllm"); without it the id is looked up.

MethodPathPurpose
POST/api/models/loadLoad {model} on whichever engine owns it.
POST/api/models/unloadUnload {model}.
POST/api/models/savePersist {settings} and apply them (restarting the process if that engine has no hot reload).
POST/api/models/deleteDelete the model's files, where the engine supports it (vLLM only; llama.cpp returns 400).

The engine-specific paths (/api/load, /api/vllm/load, …) remain as aliases.

Request requirements

The dashboard binds 127.0.0.1, which keeps it off your network but leaves it reachable by any page in your browser. Every request is therefore checked:

match it. Anything else gets 403. This blocks both cross-site requests and DNS rebinding.

form or other non-JSON content types get 415, helping block a cross-site <form>. This guard currently permits an absent Content-Type.

is 411. Malformed, duplicate, or transfer-encoded framing is 400; a short body is also 400. Rejected framing closes the connection.

/v1/chat/completions use a 64 MiB inference-proxy limit. A body over its route-class limit is 413 before it is read or dispatched.

Security.

See also config.json Reference for the settings /api/config and /api/network write, and models.ini Format for the file /api/save, /api/scan/apply, /api/scan/prune, and /api/hub/add mutate.