OpenProgram Docs

Local model providers

PresetDefaultNotes
Ollamalocalhost:11434/v1Installed model identifiers. Native management APIs excluded.
LM Studiolocalhost:1234/v1Models and streaming chat
vLLMlocalhost:8000/v1Optional server API key
llama.cpp, generic endpointConfigured addressResolved offline

All go through the Chat Completions transport cloud providers use: streaming, tool calls, cancellation, retries and structured output. The user starts the server, or a call starts it with the user's command when autostart is on; OpenProgram does not install models, allocate GPUs or stop servers.

Contract

AspectRule
AddressHost-only URLs resolve to /v1 the same way for discovery, validation and inference. Edits apply to later calls, including saved models.
DiscoveryFrom the configured server, never a cloud catalogue
CredentialsOptional. Never inherits an unrelated OpenAI key. Sent only to the configured endpoint.
URL securityExisting configured-URL checks apply
EnablementPersisted through the existing provider and model registry
SettingsAddress, optional accounts, connectivity, discovery, manual model IDs and limits
ErrorsInvalid URLs, missing servers, HTTP failures and non-JSON replies are reported as actionable failures
CompatibilityConservative OpenAI compatibility settings
Request authentication

Without a key: an explicit SDK placeholder prevents environment fallback, and each Chat Completions request omits the Authorization header. The omission must be per request, because the SDK authentication validator ignores removal of a default header alone. With a key: the configured server key. Cloud requests still need their own credential.

Starting the server on demand

  1. Request to a local providerstream_simple_with_provider, before the adapter
  2. providers.<id>.server.autostart is true and the loopback address does not answer
  3. Start commandown session, output to logs/local-server-<id>.log
  4. poll the model list every 0.25 s, up to 45 s
  5. The request goes onor the turn ends with the reason

Code: models/providers/streaming/local_server.py; the hook in models/providers/streaming/stream.py; settings in models/providers/settings/storage.py and the Worker's provider config route; CLI interfaces/cli/commands/providers/local_server.py. Tests: tests/component/providers/test_local_server_autostart.py, with a fake server program that answers /v1/models. User page: Local models.

Rules

PartRule
Settingproviders.<id>.server: autostart (bool, default off) and command (an argument list, or one string split like a shell). Only local providers accept it. Changing it clears a remembered failure
Default commandOllama ollama serve, LM Studio lms server start, when shutil.which finds the program. vLLM, llama.cpp and custom servers have none: their command names the model
When it runsOnly with autostart on, only for a loopback address, only when the cached probe (at most 2 s old) says down. A remote address is never started. The cheap check reads the provider config before anything else, so a provider without the setting pays nothing
ConcurrencyOne lock per base URL; a call that waited probes again before starting, so parallel calls start the server once
ReadyThe server lists its models. A launcher that exits 0 (lms server start) is waited for; a non-zero exit ends the wait at once with the log's last five lines
FailureLocalServerStartError with the provider, address, command and the log path. It is remembered for 60 s, so a turn's retries do not each wait out the 45 s
StoppingNever. A server that already answers is left alone; one started here runs in its own session and outlives the Worker, as if the person had started it from a terminal. The Worker only collects its exit
ApprovalNone. Turning the setting on is the consent; the command is the person's own

Why this shape

PeerWhat it does, and what we take
Hermeshermes_cli/local_runtime/supervisor.py owns a llama-server: picks a port, downloads binaries, waits up to 120 s for /health, stops it and its children. That is a model runtime; OpenProgram connects to the server the person chose, so it takes only the bounded readiness wait and the log file
PiThe llama.cpp router loads models on demand but the person starts the server (docs/llama-cpp.md). Autostart closes that gap without taking over the lifecycle
Copilot CLIDiscovers a running Ollama and does not start it. Discovery stays as it is; starting is opt-in per provider

Implementation status

Inference against a real locally deployed model has not been exercised end to end; it needs an operator-provided server.

The setting is set from the CLI (openprogram providers local-server) and the provider config route (server_autostart, server_command). The Web provider panel has no control for it yet.

Last updated · 2026-11-30