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
›build›locals›runtime›filesystem›network
providers
›Anthropic›OpenAI›Ollama›OpenRouter›xAI›Gemini›Hugging Face
›agent›graph›tool›skill›http_server
Runtime
›Observability

Hugging Face

Configuration for the Hugging Face model provider.

The huggingface sub-block configures the Hugging Face provider and its router for chat completion models. Model names use the identifiers accepted by Hugging Face, such as google/gemma-2-2b-it or meta-llama/Meta-Llama-3.1-8B-Instruct.

Fields

FieldTypeRequiredruntime()Description
modelslistnonoAllowlist of Hugging Face model identifiers. Each entry is a plain string or a config object with name and params. When omitted, no allowlist is enforced.
configblocknoConnection configuration.
config.api_keystringnoyesHugging Face API token. Wrap in secret(runtime(...)) to keep it out of build artifacts.
config.base_urlstringnoyesHugging Face router or compatible API base URL.
paramsblocknoProvider-level inference parameter defaults. Applied to every request unless overridden at the model level.

The config block is optional. When omitted, the client reads credentials from the HUGGINGFACE_API_KEY environment variable and uses the default Hugging Face router endpoint.

params

The params block sets inference parameter defaults for all models under this provider. All fields are optional and support runtime().

FieldTyperuntime()Description
max_tokensintegeryesMaximum number of tokens to generate.
temperaturefloatyesSampling temperature.
top_pfloatyesNucleus sampling probability.
top_kintegeryesTop-K sampling limit.
stop_sequenceslist of stringsyesSequences that stop generation.
frequency_penaltyfloatyesPenalty for token frequency.
presence_penaltyfloatyesPenalty for token presence.
seedintegeryesSeed for deterministic sampling.
provider_paramsobjectyesProvider-specific parameters passed directly to the API.

Example

agent.acl
providers {
  huggingface {
    models = [
      "google/gemma-2-2b-it",
      {
        name = "meta-llama/Meta-Llama-3.1-8B-Instruct"
        params {
          max_tokens  = 8192
          temperature = 0.7
        }
      }
    ]

    config {
      api_key  = secret(runtime("HUGGINGFACE_API_KEY"))
      base_url = runtime("HUGGINGFACE_BASE_URL", "https://router.huggingface.co")
    }

    params {
      max_tokens  = 4096
      temperature = 0.5
    }
  }
}

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

  model {
    provider = "huggingface"
    name     = "google/gemma-2-2b-it"
  }
}
tip

Always wrap API tokens in secret(runtime(...)). This prevents the token from appearing in build artifacts and the output of agentc inspect.

← PreviousGeminiNext →agent

© 2026 pogue.dev. All rights reserved.

Creative CommonsCC BY 4.0
On this pageFieldsparamsExample

Search docs

Search the agentc documentation