Documentation
Configuring Anthropic
- Create a Kubernetes Secret that stores the API key, replace
<your_api_key>
with an actual API key:
export ANTHROPIC_API_KEY=<your_api_key>kubectl create secret generic kagent-anthropic -n kagent --from-literal ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY
- Create a ModelConfig resource that references the secret and key name, and specify the Anthropic model you want to use:
apiVersion: kagent.dev/v1alpha1kind: ModelConfigmetadata:name: claude-model-confignamespace: kagentspec:apiKeySecretRef: kagent-anthropicapiKeySecretKey: ANTHROPIC_API_KEYmodel: claude-3-sonnet-20240229provider: Anthropicanthropic: {}
For Anthropic's Claude models, kagent automatically configures the appropriate model capabilities, including vision support for Claude-3 models. You can override these settings using the modelInfo
field if needed. For more information about model capabilities and configuration, see Custom Models.
- Apply the above resource to the cluster.
Once the resource is applied, you can select the model from the Model dropdown in the UI when creating or updating agents.
