runtime

module
v1.0.0-rc.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: Apache-2.0

README

Contenox Runtime

The engine behind the Contenox desktop app: one Go binary that runs AI agents in a project folder, with permissions you never have to switch off.

contenox-runtime is the command line, the Agent Client Protocol server for editors, and the HTTP API the desktop app talks to. It reads your files, edits them, runs your tests, and asks before anything that reaches further. Sessions, settings, approvals and provider connections are SQLite files on your machine.

Docs: contenox.com. Made by Alexander Ertli.


Install

With the desktop app from the Microsoft Store or the Linux packages, contenox-runtime is already on your PATH. On macOS and with the Windows .exe installer, choose File → Install ‘contenox-runtime’ Command in PATH in the app. On its own:

irm https://contenox.com/install.ps1 | iex
curl -fsSL https://contenox.com/install.sh | sh

The script downloads the newest release for your system and checks it against the release's SHA256SUMS before installing. Every release carries one binary per system, the checksums and a signed manifest. Details, versions and install folders: install guide.


Quick start

contenox-runtime setup                              # pick a provider, a model and an API key
contenox-runtime init                               # create .contenox/ in this project
contenox-runtime "explain the build in this folder" # chat in the current project
contenox-runtime session list                       # past chats, per project

Or register a backend yourself. Providers are configuration, not code:

contenox-runtime backend add ollama   --type ollama
contenox-runtime backend add openai   --type openai   --api-key-env OPENAI_API_KEY
contenox-runtime backend add deepseek --type deepseek --api-key-env DEEPSEEK_API_KEY
contenox-runtime backend add alibaba  --type alibaba-cloud --api-key-env DASHSCOPE_API_KEY
contenox-runtime backend add chatgpt  --type openai-codex && contenox-runtime backend login chatgpt

contenox-runtime config set default-provider ollama
contenox-runtime config set default-model    qwen3:8b

contenox-runtime backend add --help lists every provider type: Ollama (local or cloud), OpenAI, a ChatGPT subscription, OpenRouter, DeepSeek, Alibaba Cloud Model Studio, Anthropic, Mistral, Gemini, vLLM, AWS Bedrock and Vertex AI.

Connect tools:

contenox-runtime mcp add fs --transport stdio --command npx --args "-y,@modelcontextprotocol/server-filesystem,/tmp"
contenox-runtime mcp add remote --transport http --url https://mcp.example.com/mcp
contenox-runtime tools add weather --url https://api.weather.gov

Full reference: contenox.com/docs/cli/reference.


Permissions

Every tool call passes a permission set, written in agents.toml and compiled into a policy the runtime evaluates before anything runs. The shipped Default set:

  • Reads and edits the project without asking. The agent is confined to the project folder. .env files and keys ask before they are read.
  • Runs the project's own loop without asking. go test, npm run build, cargo check, pytest, make test, git reads, and plain readers such as grep, ls or Get-Content, including pipelines of them.
  • Asks before anything that reaches further. Installs, deletes, moves, git commit, git push, anything with a redirect or a $(...), and every command the list doesn't name.
  • Refuses what no agent needs. SSH and GPG keys, cloud credentials, OS keychains, password managers, wallet files, browser profiles and shell history cannot be read or written. Shell startup files, login items, git hooks and the policy itself cannot be written.

Ask always, Read only, Strict and Dev ship beside it; contenox-runtime config set hitl-policy-name hitl-policy-strict.json picks one for a project. The whole file is yours to edit: runtime/agentdecl/agents.toml is the template every install starts from.


Servers

contenox-runtime serve    # HTTP API under /api, chat and approvals over the /acp WebSocket
contenox-runtime acp      # ACP over stdio, for Zed, JetBrains, AionUi and other ACP clients

Zed, in ~/.config/zed/settings.json:

{
  "agent_servers": {
    "Contenox": {
      "type": "custom",
      "command": "contenox-runtime",
      "args": ["acp"]
    }
  }
}

Guides: Zed, JetBrains, AionUi.


Build

Go, the version in go.mod, and GNU make. Native Windows is a supported development platform.

make build            # bin/contenox-runtime (bin\contenox-runtime.exe on Windows)
make dev-install      # build and install into your per-user bin dir
bin/contenox-runtime --help

Test

make test-unit
make test-contenox-help
make test-api            # Python 3
make acp-conformance
make rust-e2e            # Rust and cargo

CONTRIBUTING.md has the full development setup; SECURITY.md says how to report a vulnerability.

The desktop app that bundles this runtime lives in contenox/harness.

For built-in native inference, see the Modeld operator guide and native build and test guide.

License

Apache-2.0.

Directories

Path Synopsis
cmd
contenox command
modeld command
Command modeld is the contenox model daemon: the per-user, per-data-root owner of resident model state.
Command modeld is the contenox model daemon: the per-user, per-data-root owner of resident model state.
modeld-companions command
Command modeld-companions generates the literal-source tokenizer companions the curated catalog requires and the manifest that embeds them in modeld.
Command modeld-companions generates the literal-source tokenizer companions the curated catalog requires and the manifest that embeds them in modeld.
internal
archiveutil
Package archiveutil provides shared, path-traversal-safe archive extraction.
Package archiveutil provides shared, path-traversal-safe archive extraction.
modeld/capacity
Package capacity is modeld's hardware capacity planner: it resolves the EFFECTIVE context window a model can actually be served at on this device, from the model's KV-cache footprint and the device's free memory — not the model's trained ceiling alone.
Package capacity is modeld's hardware capacity planner: it resolves the EFFECTIVE context window a model can actually be served at on this device, from the model's KV-cache footprint and the device's free memory — not the model's trained ceiling alone.
modeld/devicelease
Package devicelease guards physical accelerator residency across modeld data roots.
Package devicelease guards physical accelerator residency across modeld data roots.
modeld/diffusion
Package diffusion identifies the component graphs of native OpenVINO media exports.
Package diffusion identifies the component graphs of native OpenVINO media exports.
modeld/internal/sessionkit
Package sessionkit holds the small backend-neutral helpers shared by the modeld transport.Session adapters (llama.cpp in modeld/llama/llamasession and OpenVINO in modeld/openvino).
Package sessionkit holds the small backend-neutral helpers shared by the modeld transport.Session adapters (llama.cpp in modeld/llama/llamasession and OpenVINO in modeld/openvino).
modeld/llama
Package llama defines the modeld-side llama backend contract: persistent inference sessions keep a stable prefix's KV hot and re-prefill only the changed suffix.
Package llama defines the modeld-side llama backend contract: persistent inference sessions keep a stable prefix's KV hot and re-prefill only the changed suffix.
modeld/llama/llamacppshim
Package llamacppshim owns the direct llama.cpp C API boundary for modeld.
Package llamacppshim owns the direct llama.cpp C API boundary for modeld.
modeld/llama/llamasession
Capability mapping kept in an untagged, cgo-free file so the backend-parity contract can pin it verbatim in plain CI: capability drift must fail there, not only in tagged native builds.
Capability mapping kept in an untagged, cgo-free file so the backend-parity contract can pin it verbatim in plain CI: capability drift must fail there, not only in tagged native builds.
modeld/modelstore
Package modelstore resolves model names to on-disk paths within a modeld node's models directory.
Package modelstore resolves model names to on-disk paths within a modeld node's models directory.
modeld/openvino
Package openvino implements the internal/transport.Service boundary for the OpenVINO (Intel) backend: it opens persistent, manifest-keyed sessions on the owned device (CPU / GPU) that the runtime drives over the transport.
Package openvino implements the internal/transport.Service boundary for the OpenVINO (Intel) backend: it opens persistent, manifest-keyed sessions on the owned device (CPU / GPU) that the runtime drives over the transport.
modeld/openvino/ovsession
Package ovsession contains the native OpenVINO session/KV bridge used by the openvino modelrepo provider.
Package ovsession contains the native OpenVINO session/KV bridge used by the openvino modelrepo provider.
modeld/owner
Package owner manages lease-based ownership of the local runtime's resident state.
Package owner manages lease-based ownership of the local runtime's resident state.
modeld/residency
Package residency contains modeld's backend-neutral KV residency policy.
Package residency contains modeld's backend-neutral KV residency policy.
modeld/slot
Package slot enforces modeld's single active local model invariant.
Package slot enforces modeld's single active local model invariant.
modeld/snapshotauth
Package snapshotauth identifies a persistent Runtime session to Modeld on the same machine.
Package snapshotauth identifies a persistent Runtime session to Modeld on the same machine.
modeld/supervisor
Package supervisor owns shared modeld workers and their client sessions.
Package supervisor owns shared modeld workers and their client sessions.
modeldinstall
Package modeldinstall installs checksum-verified, protocol-compatible native workers.
Package modeldinstall installs checksum-verified, protocol-compatible native workers.
remedy
Package remedy names the controls that repair inference prerequisites.
Package remedy names the controls that repair inference prerequisites.
schemafile
Package schemafile decodes the machine-readable schemas the runtime embeds.
Package schemafile decodes the machine-readable schemas the runtime embeds.
transport
Package transport defines the contract the modeld daemon implements and the runtime calls: a persistent, manifest-keyed warm-reuse inference session.
Package transport defines the contract the modeld daemon implements and the runtime calls: a persistent, manifest-keyed warm-reuse inference session.
transport/grpc
Package grpc is the gRPC wire transport for the internal/transport.Service contract.
Package grpc is the gRPC wire transport for the internal/transport.Service contract.
runtime
autosetup
Package autosetup selects, installs, verifies, and configures native inference.
Package autosetup selects, installs, verifies, and configures native inference.
codecompletion
Package codecompletion owns native FIM and explicitly selected instructed completion.
Package codecompletion owns native FIM and explicitly selected instructed completion.
inferencesetup
Package inferencesetup owns inference-role configuration and verification.
Package inferencesetup owns inference-role configuration and verification.
internal/localaiapi
Package localaiapi exposes the desktop's local chat setup and model library.
Package localaiapi exposes the desktop's local chat setup and model library.
mediageneration
Package mediageneration renders workspace assets through the configured native model owner.
Package mediageneration renders workspace assets through the configured native model owner.
modelacquisition
Package modelacquisition owns curated native-model discovery and acquisition.
Package modelacquisition owns curated native-model discovery and acquisition.
modeldmanagement
Package modeldmanagement owns installation and status inspection of the local inference worker.
Package modeldmanagement owns installation and status inspection of the local inference worker.
modeldprobe
Package modeldprobe detects whether the modeld daemon / embedded engine is installed, running, or dead, so the runtime can fail honestly and the setup wizard can guide the user.
Package modeldprobe detects whether the modeld daemon / embedded engine is installed, running, or dead, so the runtime can fail honestly and the setup wizard can guide the user.
modelhardware
Package modelhardware provides read-only hardware facts before a model is downloaded.
Package modelhardware provides read-only hardware facts before a model is downloaded.
modelrepo/modeldconn
Package modeldconn is the runtime's client seam to the modeld / embedded daemon: it resolves the current lease leader (via modeldprobe), dials it over the gRPC transport, and opens sessions.
Package modeldconn is the runtime's client seam to the modeld / embedded daemon: it resolves the current lease leader (via modeldprobe), dials it over the gRPC transport, and opens sessions.
modelworkers
Package modelworkers owns IDE configuration and repair of shared local execution.
Package modelworkers owns IDE configuration and repair of shared local execution.
servicecontract
Package servicecontract defines the human and machine readable description of an application service exposed through product surfaces.
Package servicecontract defines the human and machine readable description of an application service exposed through product surfaces.
vfs
workflows
Package workflows runs project-owned JavaScript against a narrow document API.
Package workflows runs project-owned JavaScript against a narrow document API.
tools
devtool command
Command devtool holds the small cross-platform helpers behind the developer make targets, so they behave the same from PowerShell, cmd and Unix shells.
Command devtool holds the small cross-platform helpers behind the developer make targets, so they behave the same from PowerShell, cmd and Unix shells.
preseed-hashes command
version command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL