Get started
From nothing to a first request routed through auto. Two paths: the beginner path installs, configures and verifies in a few commands; the expert path is the same thing without the wrapper.
Status: ModelSaar is a public alpha. No stable release has been tagged and no package is published, so every install path below pins commit cf56cdd3416d of the main branch — the candidate described on the roadmap (two independent reviews reproduced and re-checked its defects; independent verification of this exact candidate is pending). Re-running the installer later moves you to the next pinned commit. Looking for the decision-model features (/v1/decisions, classifier mode: decision)? They are newer than the pinned commit and available only as the opt-in GitHub-only release candidate v0.1.0-rc.2 (a pre-release for testing, installed separately; see that page).
Before you start
- An inference backend with at least one model. Ollama is the first-class path:
ollama serverunning and a model pulled (for exampleollama pull gemma4:e4b). Any OpenAI-compatible server (vLLM, llama.cpp server, LM Studio) also works; you will declare its models in the config. ModelSaar never downloads models and never accepts a model's licence for you. - Python 3.10 or newer is helpful but not required. The one-line installer uses your
uvorpipxif you have one; otherwise it creates its own virtual environment with your Python 3.10+, and if your Python cannot do that (nopython3-venvon Debian/Ubuntu, or an older Python) it downloads one pinned, checksum-verifieduvbinary into~/.local/share/modelsaarand lets it create the environment. Nothing is installed into the operating system's Python andsudois never used. - macOS (Apple silicon or Intel), Linux, or Windows through WSL2. macOS arm64 and Linux x86_64 are the platforms the project has actually run on; native Windows is untested.
- Hardware: whatever your backend needs for the models you chose. ModelSaar itself is a small Python process.
1. Install
Beginner path: one command
curl -fsSL https://modelsaar.com/install.sh | shThe script is short and does only this: checks your platform; installs the ModelSaar package at the pinned commit from its GitHub source archive (no git needed) into an isolated environment — with your uv or pipx if present, otherwise into a user-owned virtual environment under ~/.local/share/modelsaar created by your Python 3.10+ or, when that is not possible, by a pinned uv it downloads and checksum-verifies for your platform (Linux x86_64/arm64, macOS; announced before the download) — then links ~/.local/bin/modelsaar if nothing else is there; runs modelsaar init if you have no config yet (it looks for Ollama on 127.0.0.1:11434 and other documented loopback ports, writes ~/.modelsaar/config.yaml and private keys with mode 600); then starts a temporary gateway, sends one request through auto, stops it and prints the result with your next step. Existing config, keys and state are never overwritten; an occupied gateway port is reported, not fought over.
To read it before running it:
curl -fsSL https://modelsaar.com/install.sh -o install.sh && less install.sh && sh install.shOptions are environment variables: MODELSAAR_ENDPOINT=http://host:port (backend other than local Ollama), MODELSAAR_PORT=8484, MODELSAAR_NO_CHECK=1 (skip the verification request), MODELSAAR_REF=<sha> (install a different commit — you take responsibility for it).
Expert path: install by hand
With uv (recommended; isolated, fetches Python 3.12 if needed):
uv tool install git+https://github.com/gopalasubramanium/modelsaar@cf56cdd3416d8c853b64111b9b40211e5b126031With pipx:
pipx install git+https://github.com/gopalasubramanium/modelsaar@cf56cdd3416d8c853b64111b9b40211e5b126031With plain Python ≥ 3.10 and pip, in a virtual environment of your own (the command is then ~/modelsaar-env/bin/modelsaar; a pip install --user into the operating system's Python is refused on Debian/Ubuntu and not recommended anywhere):
python3 -m venv ~/modelsaar-env && ~/modelsaar-env/bin/pip install git+https://github.com/gopalasubramanium/modelsaar@cf56cdd3416d8c853b64111b9b40211e5b126031From a source checkout (what the test suite and the verification scripts use):
git clone https://github.com/gopalasubramanium/modelsaar && cd modelsaar && git checkout cf56cdd3416d8c853b64111b9b40211e5b126031 && python3 -m venv .venv && . .venv/bin/activate && pip install -e .All four give you the modelsaar command and nothing else; nothing starts automatically.
2. Configure and run
Before this step an inference server with at least one model must be running (for example ollama serve after ollama pull …); ModelSaar never downloads models.
If you used the one-line installer, modelsaar init has already run (the installer printed the models it discovered) — skip to modelsaar doctor. With uv, pipx, pip or a source checkout, run it once:
modelsaar initFinds Ollama on 127.0.0.1:11434 (or pass --endpoint URL --type ollama|openai_compatible), writes ~/.modelsaar/config.yaml and keys, discovers your models. Refuses to overwrite an existing config without --force; after the installer, do not run it again.
modelsaar doctorReachability, assumed context lengths, unknown capabilities, cloud-forwarded aliases — with a remedy per warning.
modelsaar serveStarts the gateway at http://127.0.0.1:8484/v1 (loopback only). Leave it running; stop with Ctrl-C.
Optional but recommended once: modelsaar probe --all verifies streaming, tool calling, JSON schema and image input on each model with short real requests (it uses your backend's compute). Run it while the gateway is up; the probes go through the gateway so they never collide with your own traffic.
Verify
modelsaar testIn a second terminal. Identifies the listener on the configured port (GET /healthz must answer the ModelSaar health contract before any key is sent), lists the models the gateway advertises and sends one chat completion through auto; prints the deployment that answered and the request id.
If it prints an HTTP 422, no model qualified — the body says which blocker applies to each deployment and what to change. If it cannot connect, the gateway is not running on the configured port; the message says so. If something else is listening on that port, it says "not a ModelSaar gateway" and sends nothing: change server.port or stop the other service.
3. Connect an app
Any app that speaks the OpenAI Chat Completions API needs three values. First print the key in a terminal:
head -1 ~/.modelsaar/keys/api_keysPrints one line starting with msk_. That printed line is the API key to paste into a GUI field; the command itself is shell syntax, not a key.
Base URL: http://127.0.0.1:8484/v1
Model: auto
API key: msk_… (the line printed by the command above)Model alternatives: auto-fast, auto-code, auto-vision, or a concrete deployment id.
Or let ModelSaar print the exact settings for your app — one command per app:
- Open WebUI:
modelsaar client-config open-webui - OpenCode:
modelsaar client-config opencode - OpenCode (V2 config):
modelsaar client-config opencode-v2 - OpenClaw:
modelsaar client-config openclaw - Hermes Agent:
modelsaar client-config hermes
--apply merges file-based configs with a backup and keeps the file's permissions. The key never leaves your machine unless you send it somewhere.
Addresses when the app is not on the same machine. 127.0.0.1 always means "the machine (or container) where the app runs". An Open WebUI container on the same host reaches the gateway at http://host.docker.internal:8484/v1; an app on another computer needs the gateway bound beyond loopback (server.host: 0.0.0.0 and security.allow_lan: true, with TLS or a private network in front — see Privacy). modelsaar client-config … --docker prints the container form.
One model only? auto uses it whenever it qualifies; nothing else changes. More models later expand its choices without touching the app.
Running it day to day
- Keep it running
- Run
modelsaar serveunder your service manager; alaunchdplist and asystemdunit are inexamples/. Docker Compose is documented in Installation (gateway only; models stay with your runtime). - Stop / restart
- Ctrl-C in the terminal, or your service manager's stop/restart. Configuration changes need a restart; in-flight requests finish on the old config.
- Update
- Re-run the same installer command. With an existing configuration it upgrades in place: nothing is re-initialised, the new revision is validated against your configuration before it becomes current, the previous environment is kept for rollback, and on Linux a
modelsaar.serviceuser unit that belongs to the installation is restarted and checked at the address it actually listens on (details in Installation). With uv/pipx re-run the install command with the new commit. Thenmodelsaar config validateandmodelsaar doctor. Keys and state are untouched; evidence from an older evidence scheme is kept but not used until you re-probe. - Troubleshoot
modelsaar doctorfirst; thenmodelsaar decisions --limit 10for the last routing records andmodelsaar explain -m "…" [--tools --image --json-schema]to dry-run a request. More in Troubleshooting.- Uninstall
modelsaar uninstallremoves only the files ModelSaar created under~/.modelsaar(config, its backups, keys, state DB) and lists anything it left in place. Then remove the package the way it was installed:uv tool uninstall modelsaar,pipx uninstall modelsaar, or — for the installer's own environment —rm -rf ~/.local/share/modelsaarand the~/.local/bin/modelsaarlink (the installer prints the exact lines). Models and client configurations are never touched; applied client configs have.bak-<timestamp>copies next to them.
What has actually been tested
Two kinds of evidence, stated separately. At the current pinned commit the installer was run end to end with real package installations on Ubuntu 24.04 whose Python is externally managed (PEP 668), as an unprivileged user with no uv, pipx or git on PATH: user-owned virtual environment; venv support removed (pinned uv downloaded and checksum-verified, a wrong checksum refused); existing uv and pipx paths; repeat run with config and keys byte-identical; a failed attempt leaving the working installation intact; a backend outage reported with exit code 2 — against the repository's controlled fake backend, not a real model (scripts/installer_fallback_tests.py, run in CI on x86_64 and arm64). The installer and the CLI were also exercised with the package-manager step stubbed (docs/live-runs/2026-10-12-installer-scenarios/). At an earlier pin (80276bb) the then-current installer's uv, pipx and pip --user paths were executed on Linux x86_64 and uv on macOS arm64 against the owner's Ollama host (docs/live-runs/2026-10-11-installer/); the pip --user path no longer exists. A real-client walkthrough has not been run yet; it is listed in the verification report. WSL2 follows the Linux path and has not been executed by the project. Native Windows is not supported.