Anthropic
Learn how to configure Anthropic models for kagent.
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/v1alpha2
kind: ModelConfig
metadata:
name: claude-model-config
namespace: kagent
spec:
apiKeySecret: kagent-anthropic
apiKeySecretKey: ANTHROPIC_API_KEY
model: claude-3-sonnet-20240229
provider: Anthropic
anthropic: {}For Anthropic’s Claude models, kagent automatically configures the appropriate model capabilities, including vision support for Claude-3 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.
