agentc
GitHubagentc-sh/agentc
agentc
GitHubagentc-sh/agentc
›Introduction
Get started›Concepts in 5 minutes›Build your first agent›Add your first tool›Serve and connect
Concepts›Architecture overview›The manifest›The compilation pipeline›Archetypes›The graph›Tools and capabilities›Runtime libraries›Skills›Agents and prompts›Serving and protocols›Observability
Guides›Author a manifest›Write a tool›Give your agent a filesystem›Control network egress›Connect external tools via MCP›Connect agents via A2A›Use the bash tool›Control tool access with capabilities›Write templated prompts›Manage prompts with Langfuse›Pass context from the client›Configure a model provider›Connect a CopilotKit frontend›Deploy a standalone binary›Deploy with Docker and PostgreSQL›Instrument with OpenTelemetry›Extend code generation with blocks
Reference
Manifest
Runtime
›Observability

Configure a model provider

Add a model provider and set inference parameters for your agent.

An agent talks to a model through a provider. The providers block declares which providers are available and how to connect to them, and the agent's model block picks one. Inference parameters such as temperature and token limits live with the provider, not the agent. This guide covers the common setup. For the full list of providers and their fields, see the providers reference.

Declare a provider and select its model

Declare the provider, read its API key from the environment, and point the agent's model block at it. The provider must match a sub-block name, and name must be one of that provider's models:

agent.acl
providers {
  anthropic {
    models = ["claude-haiku-4-5", "claude-sonnet-4-6"]

    config {
      api_key = secret(runtime("ANTHROPIC_API_KEY"))
    }
  }
}

agent "assistant" {
  graph {
    type = "react"
  }

  model {
    provider = "anthropic"
    name     = "claude-haiku-4-5"
  }
}

The models list acts as an allowlist. When present, only the named models may be selected; when absent, any model name is accepted.

Choose the model at deployment time

The name field accepts runtime(), so a single binary can run different models per environment without recompiling:

model {
  provider = "anthropic"
  name     = runtime("AGENT_MODEL", "claude-haiku-4-5")
}

Set inference parameters

Add a params block to a provider to set defaults for every request made through it:

providers {
  anthropic {
    models = ["claude-haiku-4-5"]

    config {
      api_key = secret(runtime("ANTHROPIC_API_KEY"))
    }

    params {
      max_tokens  = 4096
      temperature = 0.5
    }
  }
}

All parameter fields are optional and fall back to the provider's built-in defaults. The full set, including top_p, top_k, stop_sequences, and others, is on the providers reference.

Override parameters for one model

To vary parameters by model, promote a models entry from a plain string to an object with its own params. Model-level values are merged over the provider defaults, so you override only what you name:

providers {
  anthropic {
    models = [
      "claude-haiku-4-5",
      {
        name = "claude-opus-4-7"
        params {
          max_tokens  = 16000
          temperature = 0.8
        }
      }
    ]

    config {
      api_key = secret(runtime("ANTHROPIC_API_KEY"))
    }

    params {
      max_tokens  = 4096
      temperature = 0.5
    }
  }
}

Requests to claude-haiku-4-5 use the provider defaults; requests to claude-opus-4-7 use its own.

Pass provider-specific options

For options outside the standard set, such as Anthropic extended thinking, use provider_params, which is passed straight through to the provider API:

params {
  provider_params = {
    thinking = {
      type          = "enabled"
      budget_tokens = 5000
    }
  }
}

Where to go next

  • Agents and prompts: how model selection fits the rest of the agent.
  • providers reference: every provider and every field of the providers block.
  • agent reference: the model block.
← PreviousPass context from the clientNext →Connect a CopilotKit frontend

© 2026 pogue.dev. All rights reserved.

Creative CommonsCC BY 4.0
On this pageDeclare a provider and select its modelChoose the model at deployment timeSet inference parametersOverride parameters for one modelPass provider-specific optionsWhere to go next

Search docs

Search the agentc documentation