Documentation

Configuring Anthropic

  1. 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
  1. Create a ModelConfig resource that references the secret and key name, and specify the Anthropic model you want to use:
apiVersion: kagent.dev/v1alpha1
kind: ModelConfig
metadata:
name: claude-model-config
namespace: kagent
spec:
apiKeySecretRef: kagent-anthropic
apiKeySecretKey: ANTHROPIC_API_KEY
model: claude-3-sonnet-20240229
provider: Anthropic
anthropic: {}
  1. 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.

kagent model selection dropdown
kagent model selection dropdown