config.json Reference

config.json lives at the repository root and holds every machine-specific setting LlamaForge needs — nothing is hardcoded into the source. It is created by the bootstrap scripts on first run and updated by the dashboard (POST /api/config, POST /api/network) as you use it. backend/config.py defines the defaults; any key missing from the file on disk falls back to its default at load time.

Keys

KeyTypeDefaultMeaning
llama_srcstring""Path to a git checkout of llama.cpp.
build_dirstring""CMake build directory for llama.cpp (usually <llama_src>/build).
server_binstring""Path to the built llama-server (or llama-server.exe) binary.
models_inistring<repo root>/models.iniPath to the models.ini preset file passed to llama-server --models-preset.
model_dirslist[]Directories the Discover/scan feature searches for GGUF files.
router_portint8080Port llama-server (the router) listens on.
panel_portint8090Port the LlamaForge dashboard (backend/server.py) listens on.
router_hoststring"127.0.0.1"Router bind address. The Network Access UI supports only 127.0.0.1 (local) and 0.0.0.0 (LAN).
router_api_keystring""Plaintext API key required for LAN. It is not returned in ordinary dashboard state.
wsl_distrostring""WSL distro that runs vLLM. Empty string auto-picks the default distro.
vllm_portint8081Port vLLM serves on inside WSL (localhost-forwarded to Windows).
cmake_flagsobject{}Persisted CMake build flags, normally seeded from hardware detection.
git_remotestring"https://github.com/ggml-org/llama.cpp"Remote used to clone/update the llama.cpp source.
active_enginestring"llamacpp"Which llama-family binary the router uses: "llamacpp" or "ikllama".
ik_llama_srcstring""Path to a git checkout of ik_llama.cpp.
ik_llama_build_dirstring""CMake build directory for ik_llama.
ik_llama_server_binstring""Path to ik_llama's built llama-server; empty leaves the engine disabled.
ik_llama_models_inistring""ik_llama's own registry; empty resolves to a -ikllama sibling of models_ini.
ik_llama_git_remotestring"https://github.com/ikawrakow/ik_llama.cpp"Remote used to clone/update ik_llama.
ik_llama_cmake_flagsobject{}Persisted CMake build flags for the ik_llama build.
auto_load_modelstring""Model id to load automatically on launch. Empty string disables auto-load.
presetsobject{}Named knob sets: {name: {knob: value}}, managed from the dashboard.
preset_bindingsobject{}Preset bound as each model's default, scoped by llama-family engine: {engine: {model_id: preset_name}}.
preset_binding_snapshotsobject{}Engine-scoped values materialized by a preset binding: {engine: {model_id: {knob: value}}}. LlamaForge uses these snapshots to retain model values you subsequently change yourself.
ui_modestring"lite""lite" shows a curated knob set; "advanced" exposes all ~220 llama-server flags.
onboardedboolFalseWhether the first-run wizard has already been shown; set to True once dismissed.
anthropic_default_modelstring""Fallback local model id used by the Anthropic-compatible shim when a request doesn't map to one.
anthropic_shim_enabledboolTrueWhether /v1/messages (Anthropic-compatible) is served.
wiki_dirstring""Context-doc directory for the wiki feature. Empty string resolves to <repo root>/wiki.
wiki_profilesobject{}Named context-doc profiles: {name: {"docs": [...], "description": str}}.
wiki_activeobject{}Active profile per model: {model_id: profile_name}.
themestring""UI theme. Empty string follows OS/localStorage; otherwise "light" or "dark".
cvdboolFalseEnables the colorblind-safe palette and non-color status cues.
vram_bandwidthsobject{}Optional {vram_bw, ram_bw, disk_bw} GB/s overrides for the VRAM-fit estimate; empty uses GPU presets/defaults.
vram_predict_enabledboolTrueWhether the offline VRAM-fit/tok-s estimate is computed (Discover, on expand).
docs_dirstring""Directory the in-app docs viewer reads from. Empty string resolves to <repo root>/docs/content.

36 keys total, matching DEFAULTS in backend/config.py.

Preset bindings

Binding a preset makes it the default for a model in the active llama-family engine (llamacpp or ikllama). When a binding is created or its preset is edited, LlamaForge materializes only preset knobs that the model has not set. preset_binding_snapshots records those materialized values so unbinding, deleting a preset, or removing a knob cleans up only values that are still unchanged; manual model overrides remain in models.ini. Older flat binding maps are migrated to the engine that was active when they were saved.

Loading and saving

config.load() deep-copies DEFAULTS and overlays whatever is present in config.json on disk, so a config file written before a new key was added still works — the new key simply falls back to its default. config.save() writes the full in-memory dict back to disk as indented JSON.

config.migrate() runs once at server startup (backend/server.py main()) to classify pre-existing installs: a config file with no ui_mode key is treated as a legacy install. If server_bin is already set, it is stamped ui_mode: "advanced" and onboarded: True; otherwise it gets ui_mode: "lite" and onboarded: False, so the onboarding wizard shows. The migration is idempotent — a config that already has ui_mode is returned unchanged.

See also models.ini Format for the preset file models_ini points at, and HTTP API for the endpoints that read and write these keys.

Network Access and historical configuration

POST /api/network is the supported way to change the router scope and key. It uses explicit keep, generate, replace, and local-only clear actions; newly configured LAN access requires a usable key and LlamaForge-owned starts fail closed without one. config.json is a normal plaintext file, not an OS credential vault.

LlamaForge assesses existing values read-only. A printable older LAN key can remain in use as protected_legacy and is marked for rotation. A manually edited unsupported host, or LAN with an absent or invalid key, remains visible as unsafe_legacy; it is not auto-rewritten, but future starts and restarts are blocked until you generate/replace a key or return the router to local access.