Article

NoirCode Models and the Provider Layer

NoirCode is model-agnostic in a specific sense: the agent and the tools stay the same when you change the model id. It does not classify prompts, estimate difficulty, or move a request between vendors to save money.

How a model is chosen

You choose it.

If the configured default is disabled or its provider is missing, NoirCode uses the newest available supported model. Credentials from another project do not come along. NOIRCODE_DISABLE_FREE_MODELS=1 hides free NoirCode models on the server.

The catalog is models.dev plus provider integrations plus your config. Built-in connections include the major commercial APIs and NoirCode’s own providers. NoirCode Go is an optional subscription with its own model list and usage tiers. NoirCode Console is optional too. A custom provider looks like this:

{
  "providers": {
    "acme": {
      "name": "Acme",
      "env": ["ACME_API_KEY"],
      "package": "@noircode/ai/providers/openai-compatible",
      "settings": { "baseURL": "https://llm.acme.example/v1" },
      "models": { "qwen3-coder": { "name": "Qwen 3 Coder" } }
    }
  }
}

That baseURL is how a private vLLM, Ollama, or other OpenAI-compatible server is attached. NoirCode does not ship a GPU cluster, a regional load balancer, or a circuit breaker around those hosts.

What the adapter does

The agent emits a normal model request: messages, tool definitions, and the settings for the selected model and variant. The provider package turns that into the vendor’s HTTP API. From the session’s point of view, OpenAI, Anthropic, Gemini, Go, and a local compatible endpoint are the same kind of call. Streaming comes back as session.text.delta and session.reasoning.delta.

Tools run before and between those calls, on your machine. The model sees tool results only after a tool has been permitted and executed. It does not see the repository except through those results and the conversation.

There is no second model that automatically reviews the first, and no consensus vote across Claude, GPT, and Gemini. You can ask the Build agent to launch a subagent, such as a reviewer you defined, and that subagent can use a different model. That happens because you asked, or because the agent chose the subagent, not because a router scored the prompt.

Context, cost, and failure

Cost follows the model you selected. The session records usage. NoirCode does not downgrade models as a daily budget runs out, and it does not split traffic 80/15/5 across small, medium, and large models.

Context is the assembled prompt. Compaction summarizes older turns when the window is close to full and keeps a recent slice, about 15,000 tokens by default. Hidden agents named compaction, title, and summary do that maintenance. They cannot be selected as the coding agent. V1’s small_model setting is only migrated onto the title agent. It is not a live complexity router.

session.retry.scheduled means the same step will be tried again after an error. It is not a provider failover chain. To avoid a provider, deny it with a policy:

{
  "policies": [{ "action": "provider.use", "resource": "openai", "effect": "deny" }]
}

A denied provider disappears from the catalog even if the key is present.

Session memory and model memory

The server stores the session: messages, the agent, the model, tool results, and usage. That database is on disk under the path noircode debug paths db prints. The model does not keep that store. Each request contains the prompt the server built for that step. After compaction, older detail exists as the summary plus the kept recent tokens.

The inference layer is the provider adapter, the session, and the tool loop. Choosing a different model changes who answers. It does not change where the code lives or which tools are allowed.