Skip to content

RuntimeConfig

RuntimeConfig is a Kubernetes-style YAML manifest that declaratively configures the SDK runtime environment. It separates what an agent does (defined in a pack) from how to run it (providers, tool bindings, state store, logging). This makes packs portable across environments while RuntimeConfig adapts them to each deployment target.

The Go types backing this schema live in pkg/config/runtime_config.go and pkg/config/types.go.


FieldTypeRequiredDescription
apiVersionstringyesMust be promptkit.altairalabs.ai/v1alpha1.
kindstringyesMust be RuntimeConfig.
metadataobjectnoStandard resource metadata.
specobjectyesRuntime configuration specification.

Standard Kubernetes-style metadata. All fields are optional.

FieldTypeDescription
namestringHuman-readable name for this configuration.
namespacestringNamespace for the resource.
labelsmap[string]stringKey-value pairs for organizing resources.
annotationsmap[string]stringArbitrary metadata annotations.

The spec object contains all runtime configuration. Every field in spec is optional — include only the sections you need.

FieldTypeDescription
providersProvider[]LLM provider configurations.
toolsmap[string]ToolSpecTool implementation bindings keyed by pack tool name.
mcp_serversMCPServerConfig[]MCP tool server configurations.
state_storeStateStoreConfigConversation state persistence.
loggingLoggingConfigSpecLog levels, format, and per-module settings.
evalsmap[string]ExecBindingExternal eval process bindings keyed by eval type name.
hooksmap[string]ExecHookExternal hook process configurations.

Array of LLM provider configurations. Each entry configures credentials, model selection, rate limits, and default generation parameters for one provider.

Validation requires type and model on every entry.

FieldTypeRequiredDescription
idstringnoUnique provider identifier. Used to reference this provider elsewhere.
typestringyesProvider type. One of: claude, openai, gemini, ollama, vllm, voyageai, mock, replay.
modelstringyesModel name (e.g., claude-sonnet-4-20250514, gpt-4o).
base_urlstringnoCustom API base URL. Overrides the default endpoint for the provider type.
credentialobjectnoAPI key configuration. See credential.
defaultsobjectnoDefault generation parameters. See defaults.
rate_limitobjectnoRate limiting. See rate_limit.
pricingobjectnoToken cost tracking. See pricing.
platformobjectnoCloud platform config for hyperscaler hosting. See platform.
capabilitiesstring[]noDeclared provider capabilities: text, streaming, vision, tools, json, audio, video, documents.
include_raw_outputboolnoInclude raw API request/response in output for debugging.
additional_configmap[string]anynoProvider-specific configuration not covered by other fields.

Credentials are resolved in order of precedence: api_key > credential_file > credential_env.

FieldTypeDescription
api_keystringExplicit API key value. Not recommended for production — prefer credential_env.
credential_filestringPath to a file containing the API key.
credential_envstringName of an environment variable containing the API key.

Default generation parameters applied to every request unless overridden per-call.

FieldTypeDescription
temperaturefloatSampling temperature (e.g., 0.7).
top_pfloatTop-p (nucleus) sampling parameter.
max_tokensintMaximum number of output tokens.
FieldTypeDescription
rpsintMaximum requests per second.
burstintMaximum burst size above the steady-state rate.

Used for cost tracking and reporting.

FieldTypeDescription
input_cost_per_1kfloatCost per 1,000 input tokens.
output_cost_per_1kfloatCost per 1,000 output tokens.

Configures hyperscaler hosting platforms (Bedrock, Vertex, Azure) that provide managed access to LLM providers. The platform.type determines authentication and endpoint resolution, while the parent type field determines message/response handling.

FieldTypeDescription
typestringPlatform type: bedrock, vertex, or azure.
regionstringCloud region (e.g., us-west-2, us-central1).
projectstringCloud project ID. Required for Vertex.
endpointstringCustom endpoint URL override.
additional_configmap[string]anyPlatform-specific settings.

Map of tool bindings. Keys are tool names that must match names declared in the pack. Values configure how the tool is implemented at runtime.

Each tool spec can use one of several modes: mock (canned responses), live (HTTP), exec (subprocess), or client (client-side execution).

FieldTypeRequiredDescription
namestringnoTool name (usually inferred from the map key).
descriptionstringyesHuman-readable description of the tool.
input_schemaobjectyesJSON Schema (Draft-07) defining the tool’s input.
output_schemaobjectyesJSON Schema (Draft-07) defining the tool’s output.
modestringyesExecution mode: mock, live, exec, or client.
timeout_msintnoPer-invocation timeout in milliseconds.
mock_resultanynoStatic mock response (mode: mock).
mock_templatestringnoGo template for dynamic mock responses (mode: mock).
mock_partsMockPartSpec[]noMultimodal mock response parts (mode: mock).
httpobjectnoHTTP binding configuration (mode: live).
execobjectnoSubprocess binding configuration (mode: exec). See exec.
clientobjectnoClient-side execution configuration (mode: client).

Subprocess binding for tools. The command is resolved relative to the config file.

FieldTypeDescription
commandstringPath to the executable.
argsstring[]Additional command arguments.
runtimestringExecution mode: exec (one-shot, default) or server (long-running JSON-RPC).
envstring[]Environment variable names to pass through from the host.
timeout_msintPer-invocation timeout in milliseconds.

Map of external eval process bindings. Keys are eval type names matching those used in the pack. Eval types not bound here resolve to built-in Go handlers.

Each value is an ExecBinding:

FieldTypeRequiredDescription
commandstringyesPath to the executable.
argsstring[]noAdditional command arguments.
runtimestringnoExecution mode: exec (default) or server.
envstring[]noEnvironment variable names to pass through from the host.
timeout_msintnoPer-invocation timeout in milliseconds.

Map of external hook bindings. Keys are hook names (arbitrary identifiers). Each hook binds an external process to pipeline lifecycle events.

FieldTypeRequiredDescription
commandstringyesPath to the executable.
argsstring[]noAdditional command arguments.
hookstringyesHook interface type: provider, tool, or session.
phasesstring[]noLifecycle phases to intercept. See below.
modestringnoExecution mode: filter (synchronous, can modify/deny; default) or observe (async, fire-and-forget).
runtimestringnoProcess mode: exec (default) or server.
envstring[]noEnvironment variable names to pass through from the host.
timeout_msintnoPer-invocation timeout in milliseconds.
Hook typeValid phases
providerbefore_call, after_call
toolbefore_execution, after_execution
sessionsession_start, session_update, session_end

Array of MCP (Model Context Protocol) server configurations. Each entry starts and manages a stdio-based MCP server process.

Validation requires name and command on every entry.

FieldTypeRequiredDescription
namestringyesUnique server name.
commandstringyesCommand to start the server process.
argsstring[]noCommand arguments.
envmap[string]stringnoEnvironment variables passed to the server process.
working_dirstringnoWorking directory for the server process.
timeout_msintnoPer-request timeout in milliseconds.
tool_filterobjectnoTool filtering configuration. See tool_filter.

Controls which tools from the MCP server are exposed to the LLM. If both lists are set, allowlist is applied first, then blocklist removes from the result.

FieldTypeDescription
allowliststring[]Only expose tools with these names.
blockliststring[]Hide tools with these names.

Configures conversation state persistence. Defaults to in-memory storage when omitted.

FieldTypeRequiredDescription
typestringnoStore implementation: memory (default) or redis.
redisobjectconditionalRedis configuration. Required when type is redis. See redis.
FieldTypeRequiredDescription
addressstringyesRedis server address (host:port).
passwordstringnoRedis authentication password.
databaseintnoRedis database number (0-15, default: 0).
ttlstringnoKey TTL as a Go duration string (e.g., 24h, 168h). Default: 24h.
prefixstringnoKey prefix for all state keys. Default: promptkit.

Configures structured logging output.

FieldTypeRequiredDescription
defaultLevelstringnoDefault log level: trace, debug, info (default), warn, error.
formatstringnoOutput format: text (default) or json.
commonFieldsmap[string]stringnoKey-value pairs added to every log entry. Useful for environment, service name, etc.
modulesModuleLoggingConfig[]noPer-module log level overrides. See modules.

Override log levels for specific subsystems. More specific module names take precedence over less specific ones.

FieldTypeDescription
namestringModule name using dot notation (e.g., runtime, runtime.pipeline, providers.openai).
levelstringLog level for this module: trace, debug, info, warn, error.
fieldsmap[string]stringAdditional fields added to logs from this module.

apiVersion: promptkit.altairalabs.ai/v1alpha1
kind: RuntimeConfig
metadata:
name: production
labels:
env: prod
spec:
providers:
- id: main-llm
type: claude
model: claude-sonnet-4-20250514
credential:
credential_env: ANTHROPIC_API_KEY
defaults:
temperature: 0.7
max_tokens: 4096
rate_limit:
rps: 10
burst: 20
pricing:
input_cost_per_1k: 0.003
output_cost_per_1k: 0.015
- id: embeddings
type: voyageai
model: voyage-3
credential:
credential_env: VOYAGE_API_KEY
tools:
search_knowledge_base:
description: Search the knowledge base
input_schema:
type: object
properties:
query:
type: string
output_schema:
type: object
properties:
results:
type: array
mode: exec
exec:
command: ./tools/search
args: ["--format", "json"]
runtime: server
env: [DATABASE_URL]
timeout_ms: 5000
get_weather:
description: Get current weather
input_schema:
type: object
properties:
location:
type: string
output_schema:
type: object
mode: live
http:
url: https://api.weather.com/v1/current
method: GET
evals:
custom_accuracy:
command: ./evals/accuracy
args: ["--strict"]
env: [EVAL_API_KEY]
timeout_ms: 30000
hooks:
audit_log:
command: ./hooks/audit
hook: provider
phases: [before_call, after_call]
mode: observe
env: [AUDIT_ENDPOINT]
timeout_ms: 2000
pii_filter:
command: ./hooks/pii-filter
hook: tool
phases: [after_execution]
mode: filter
timeout_ms: 1000
mcp_servers:
- name: filesystem
command: npx
args: ["-y", "@modelcontextprotocol/server-filesystem", "/data"]
timeout_ms: 10000
tool_filter:
blocklist: [delete_file]
- name: database
command: ./mcp-servers/db-server
env:
DATABASE_URL: postgres://localhost:5432/mydb
working_dir: /opt/mcp
tool_filter:
allowlist: [query, list_tables]
state_store:
type: redis
redis:
address: localhost:6379
password: secret
database: 1
ttl: 168h
prefix: myapp
logging:
defaultLevel: info
format: json
commonFields:
service: my-agent
env: production
modules:
- name: runtime.pipeline
level: debug
- name: providers
level: warn

  • Use RuntimeConfig — how-to guide for loading and applying RuntimeConfig
  • Exec Tools — how-to guide for subprocess tool bindings
  • Exec Hooks — how-to guide for external process hooks