Skip to content

docs: add LLMInferenceService with AgentGateway integration guide#697

Open
mgonzalezo wants to merge 1 commit into
kserve:mainfrom
mgonzalezo:docs/llmisvc-agentgateway-integration
Open

docs: add LLMInferenceService with AgentGateway integration guide#697
mgonzalezo wants to merge 1 commit into
kserve:mainfrom
mgonzalezo:docs/llmisvc-agentgateway-integration

Conversation

@mgonzalezo

Copy link
Copy Markdown
Contributor

Related to kserve/kserve#5729

Add a procedural guide for integrating LLMInferenceService with AgentGateway
to enable LLM-aware routing, token tracking, and GenAI telemetry using the
existing LLMInferenceServiceConfig backendRef override mechanism.

Proposed Changes

  • Add docs/model-serving/generative-inference/llmisvc/llmisvc-agentgateway.md with step-by-step instructions for overriding HTTPRoute backendRef to use AgentgatewayBackend
  • Document two approaches: per-service override via spec.router.route.http and reusable LLMInferenceServiceConfig via baseRefs
  • Add sidebar entry under LLMInferenceService alongside the existing Envoy AI Gateway guide

@netlify

netlify Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deploy Preview for elastic-nobel-0aef7a ready!

Name Link
🔨 Latest commit b326be3
🔍 Latest deploy log https://app.netlify.com/projects/elastic-nobel-0aef7a/deploys/6a48ff668153da0008883cb4
😎 Deploy Preview https://deploy-preview-697--elastic-nobel-0aef7a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mgonzalezo mgonzalezo force-pushed the docs/llmisvc-agentgateway-integration branch from c557711 to 684e325 Compare July 3, 2026 09:06

@bartoszmajsak bartoszmajsak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution. Very happy to see that flexibility of the API makes such integration quite straightforward.

I have couple of suggestions and a gap we will address on our side.

| Protocol detection | `http` (generic) | `llm` (LLM-aware) |
| Token parsing | No | Yes |
| Model tracking | No | Yes |
| GenAI telemetry (OTel) | No | Yes |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this accurate? We lately added this integration, so I am not sure this is AgentgatewayBackend specific feature.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for flagging #5481. I've clarified the table: KServe's distributed tracing provides request-level spans/traces, while the GenAI semantic conventions here refer to LLM-specific OTel attributes (gen_ai.usage.input_tokens, gen_ai.request.model, etc.) that AgentGateway emits at the gateway level. Added a note explaining they're complementary.

Comment thread sidebars.ts Outdated
"model-serving/generative-inference/llmisvc/llmisvc-config-composition",
"model-serving/generative-inference/llmisvc/llmisvc-dependencies",
"model-serving/generative-inference/llmisvc/llmisvc-envoy-ai-gateway",
"model-serving/generative-inference/llmisvc/llmisvc-agentgateway",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could have a dedicated section for both agentgateway and envoy-ai-gateway under "Integrations"? (I am terrible at naming...)

@mgonzalezo mgonzalezo Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved both llmisvc-envoy-ai-gateway and llmisvc-agentgateway under a new "Integrations" subcategory within LLMInferenceService

Comment on lines +130 to +131
host: my-model-kserve-workload-svc.kserve-test.svc.cluster.local
port: 8000

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, host and port now sit under .provider alongside the provider type, matching the API reference. Also switched from custom to openai provider type since KServe runtimes expose OpenAI-compatible endpoints.

nvidia.com/gpu: 1
```

Wait for the InferenceService to be ready:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Wait for the InferenceService to be ready:
Wait for the LLMInferenceService to be ready:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

router:
scheduler: {}
route: {}
gateway: {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed b/c below you are using:

parentRefs:
   - group: gateway.networking.k8s.io
     kind: Gateway
     name: agentgateway
     namespace: kserve-test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, since the route override uses explicit parentRefs, I removed it from examples.

name: Qwen/Qwen2.5-0.5B-Instruct
replicas: 1
router:
scheduler: {}

@bartoszmajsak bartoszmajsak Jul 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting scheduler: {} is unnecessary here and actually problematic - it creates an EPP deployment and InferencePool that no HTTPRoute references. AgentGateway won't write an Accepted status for the pool since no route targets it, leaving InferencePoolReady stuck at WaitingForGateway and blocking the overall Ready condition indefinitely. On top of that, AgentGateway doesn't even watch InferencePool resources unless inferenceExtension.enabled=true is set (disabled by default).

@pierDipi, maybe we should signal misconfig in the conditions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the clarification, I have removed it from the examples. Happy to help with a follow-up PR once you and @pierDipi agree on the right approach here.

Signed-off-by: Marco Gonzalez <margonza@redhat.com>

docs: address review feedback on AgentGateway integration guide

Signed-off-by: Marco Gonzalez <margonza@redhat.com>
@danehans

danehans commented Jul 7, 2026

Copy link
Copy Markdown

xref: kserve/kserve#5518

bartoszmajsak added a commit to bartoszmajsak/playground that referenced this pull request Jul 15, 2026
…-aware routing

Proves that overriding backendRef in KServe-generated HTTPRoutes
from InferencePool to AgentgatewayBackend activates AgentGateway's
full LLM pipeline - GenAI telemetry, token tracking, and token-based
rate limiting.

Without this override, AgentGateway treats inference traffic as
generic HTTP, missing model-aware observability and rate controls.
The spike validates the integration described in kserve/website#697
using a tiny vLLM model on kind with no GPU required.

Ref: kserve/kserve#5729
Signed-off-by: Bartosz Majsak <bartosz.majsak@gmail.com>
@danehans

Copy link
Copy Markdown

@bartoszmajsak when you have a moment, PTAL. I see you are testing this PR in https://github.com/bartoszmajsak/playground via bartoszmajsak/playground@f8a7a2c. Can you help me understand if this is part of the typical validation workflow.

@bartoszmajsak

bartoszmajsak commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@bartoszmajsak when you have a moment, PTAL. I see you are testing this PR in https://github.com/bartoszmajsak/playground via bartoszmajsak/playground@f8a7a2c. Can you help me understand if this is part of the typical validation workflow.

@danehans This is related I think, PTAL kserve/kserve#5776

@bartoszmajsak

Copy link
Copy Markdown
Contributor

Can you help me understand if this is part of the typical validation workflow.

@danehans not quite sure what the exact ask is - I was simply testing samples from this doc e2e out of curiosity. And both feedback here and PR linked previously are the results of this "spike".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants