DocsCommonagent-configModelConfig
Package: @hexos/common

Configuration for an LLM provider connection, specifying which model to use and how to connect.

Each AgentDefinition requires a ModelConfig to determine its LLM backend. The apiKey field supports both static strings and async functions for dynamic key retrieval (e.g., from a secrets manager). The baseUrl field enables custom endpoints for proxies or self-hosted providers.

Related: LLMProvider determines the provider, AgentDefinition uses this config.

interface ModelConfig {
    provider: LLMProvider;
    model: string;
    temperature?: number;
    maxTokens?: number;
    apiKey?: string | (() => Promise<string>);
    baseUrl?: string;
}

provider

model

string

temperature

number

maxTokens

number

apiKey

string | (() => Promise)

baseUrl

string