For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
TypeSafe
Configure TypeSafe Jev as an LLM provider for agentgateway.
Configure TypeSafe Jev, TypeSafe’s evaluation model, as an LLM provider in agentgateway. The Typesafe preset sends requests to TypeSafe in its native SystemOne format. Clients send OpenAI Decisions API requests, and agentgateway translates them to SystemOne before they reach TypeSafe.
The preset accepts only Decisions and SystemOne requests. Chat Completions, Responses, and Messages requests to a TypeSafe model fail.
Before you begin
- Install and set up an agentgateway proxy.
- Allow the
AgentgatewayModelroute kind on thehttplistener of theagentgateway-proxyGateway. For the steps, see Enable LLM serving on a listener.
Set up access to TypeSafe
Store your TypeSafe API key in a Secret, and create a model that uses the Typesafe preset. The model attaches directly to the Gateway listener, so you do not create an AgentgatewayBackend or an HTTPRoute.
Get an API key from TypeSafe.
Save the API key in an environment variable.
export TYPESAFE_API_KEY='<your-api-key>'Create a Kubernetes Secret to store your API key.
kubectl apply -f- <<EOF apiVersion: v1 kind: Secret metadata: name: typesafe-secret namespace: agentgateway-system type: Opaque stringData: Authorization: $TYPESAFE_API_KEY EOFCreate an AgentgatewayModel that uses the
Typesafepreset and references the Secret.kubectl apply -f- <<EOF apiVersion: agentgateway.dev/v1alpha1 kind: AgentgatewayModel metadata: name: typesafe namespace: agentgateway-system spec: parentRefs: - group: gateway.networking.k8s.io kind: Gateway name: agentgateway-proxy sectionName: http match: model: jev-latest provider: Typesafe policies: auth: secretRef: name: typesafe-secret EOFReview the following table to understand this configuration. For more information, see the API docs.
Setting Description spec.match.modelThe model name that clients send in requests. spec.providerThe Typesafepreset. The preset supplies the default URL,https://api.typesafe.ai/v1, and the SystemOne request format.spec.policies.auth.secretRefThe Secret that holds your TypeSafe API key. Send an OpenAI Decisions API request to the model. Agentgateway translates the request to the TypeSafe
/v1/systemoneAPI, and translates the response back to the Decisions format. The response answers each question in the request.curl "http://$INGRESS_GW_ADDRESS/v1/decisions" \ -H 'Content-Type: application/json' \ -d '{ "model": "jev-latest", "input": [{"role": "user", "content": [{"type": "input_text", "text": "The package was left in the rain and the box is soaked through."}]}], "questions": [{"type": "predicate", "name": "visible_damage", "instructions": "Does the customer report visible damage to the package?"}] }' | jqExample output:
{ "model": "jev-latest", "answers": [ {"type": "predicate", "name": "visible_damage", "probability": 0.64} ], "usage": {"input_tokens": 156, "output_tokens": 0, "total_tokens": 156} }
Next steps
For more information about Decisions requests, see Decisions. To declare the SystemOne format on a custom provider instead of the preset, see Custom providers.
Cleanup
You can remove the resources that you created in this guide.kubectl delete AgentgatewayModel typesafe -n agentgateway-system
kubectl delete secret typesafe-secret -n agentgateway-system