Skip to content

feat(llmd): add dedicated llm-d provider - #665

Merged
SantiagoDePolonia merged 4 commits into
mainfrom
feat/llm-d
Aug 8, 2026
Merged

feat(llmd): add dedicated llm-d provider#665
SantiagoDePolonia merged 4 commits into
mainfrom
feat/llm-d

Conversation

@SantiagoDePolonia

@SantiagoDePolonia SantiagoDePolonia commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a dedicated llmd provider for llm-d Router/EPP OpenAI-compatible inference
  • inject trusted objective and fairness metadata with mixed-version header compatibility, while exposing EPP request-drop reasons
  • add environment, YAML, Helm, passthrough, documentation, and dashboard support
  • keep API keys optional for keyless in-cluster llm-d deployments, including Helm existing-secret configurations

Testing

  • go test ./...
  • golangci-lint run ./internal/providers/llmd/... ./internal/providers/... ./config/... ./internal/server/... ./run/...
  • npm test (476 tests) and npm run check in web/dashboard
  • Helm lint with keyless llm-d plus providers.existingSecret
  • Mintlify validation
  • repository pre-commit suite, including race tests, dashboard dist sync, performance guard, lint, and docs validation
  • local OpenAI-compatible smoke test through GoModel with qwen2.5:0.5b

Notes

The local model smoke test exercised the provider through an OpenAI-compatible Ollama endpoint. llm-d-specific request headers, trust-boundary behavior, routing, shared key rotation, and dropped-reason propagation are covered by HTTP integration tests.

Summary by CodeRabbit

  • New Features

    • Added llm-d as a supported provider, enabled by default for passthrough access.
    • Added support for chat, completions, responses, embeddings, streaming, model listing, and passthrough operations.
    • Added configurable routing, model selection, authentication, inference objectives, and fairness behavior.
    • Added Helm and environment-variable configuration, including optional keyless access.
  • Documentation

    • Added comprehensive llm-d setup, configuration, routing, authentication, fairness, and troubleshooting guidance.
    • Added llm-d links throughout provider documentation and the dashboard.

@mintlify

mintlify Bot commented Aug 8, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
gomodel 🟢 Ready View Preview Aug 8, 2026, 4:47 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@SantiagoDePolonia, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 459bf490-5817-416e-962c-7fb216dbcc75

📥 Commits

Reviewing files that changed from the base of the PR and between 8a58f09 and 42918a3.

⛔ Files ignored due to path filters (2)
  • internal/admin/dashboard/static/dist/assets/index-SXsqspkt.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (24)
  • .env.template
  • CLAUDE.md
  • README.md
  • config/config.example.yaml
  • config/config.go
  • config/config_test.go
  • config/server.go
  • docs/advanced/config-yaml.mdx
  • docs/advanced/configuration.mdx
  • docs/docs.json
  • docs/features/passthrough-api.mdx
  • docs/providers/overview.mdx
  • helm/README.md
  • helm/values.schema.json
  • helm/values.yaml
  • internal/providers/config_test.go
  • internal/providers/llmd/llmd_test.go
  • internal/server/handlers_test.go
  • internal/server/passthrough_support.go
  • internal/usage/cost_test.go
  • run/providers.go
  • run/providers_test.go
  • web/dashboard/src/pages/overview/providersLogic.js
  • web/dashboard/tests/overview-providers.test.js
📝 Walkthrough

Walkthrough

This change adds an llm-d provider with configurable routing controls, passthrough APIs, Helm support, registration, tests, dashboard linking, and documentation. It also updates the OpenCode Go configuration reference.

Changes

llm-d provider

Layer / File(s) Summary
Configuration and provider resolution
.env.template, config/..., internal/providers/config.go, internal/providers/config_test.go
Adds llm-d base URL, model, inference-objective, and fairness settings. Resolves environment overlays and validates provider discovery.
llm-d API and passthrough behavior
internal/providers/llmd/...
Adds native API methods, endpoint routing, trusted header handling, fairness propagation, and dropped-request metadata processing.
Provider registration and shared integration
run/..., internal/server/..., internal/usage/..., web/dashboard/...
Registers llm-d, adds default passthrough and pricing coverage, and maps the provider to documentation.
Helm configuration and environment wiring
helm/values.yaml, helm/values.schema.json, helm/templates/_helpers.tpl, helm/README.md
Adds llm-d values, base URL validation, optional API-key handling, control environment variables, and installation examples.
llm-d documentation and examples
README.md, docs/advanced/..., docs/providers/..., docs/features/..., docs/docs.json
Documents llm-d configuration, routing metadata, supported routes, authentication, fairness behavior, and multiple service configurations.

OpenCode Go documentation

Layer / File(s) Summary
OpenCode Go configuration reference
CLAUDE.md
Documents the OpenCode Go base URL and messages model settings.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • ENTERPILOT/GoModel#664: Adds a separate OpenAI-compatible provider with similar registration, configuration, passthrough, Helm, documentation, and dashboard integration.
  • ENTERPILOT/GoModel#538: Adds another provider across registration, configuration, Helm, tests, and documentation.
  • ENTERPILOT/GoModel#392: Adds and registers an OpenAI-compatible provider with passthrough support and provider-specific implementation.

Poem

A rabbit checks each trusted route,
While headers find their proper suit.
Models, fairness, keys align,
Helm charts carry every sign.
llm-d joins the provider line!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.68% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding a dedicated llm-d provider.
Description check ✅ Passed The description clearly explains the provider changes, testing, and deployment considerations, despite using Summary instead of the template's Description heading.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/llm-d

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

codecov-commenter commented Aug 8, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 76.11111% with 43 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/providers/llmd/llmd.go 73.57% 31 Missing and 6 partials ⚠️
internal/providers/config.go 84.61% 2 Missing and 2 partials ⚠️
internal/server/passthrough_support.go 83.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/providers/llmd.mdx`:
- Around line 30-33: Update the optional controls section in the LLMD provider
documentation to state the default behavior of LLMD_INFERENCE_OBJECTIVE when
omitted, including whether GoModel omits the objective header or injects a
default value, and explain when users should override it.
- Around line 85-93: Update the curl fairness example to authenticate with a
managed key or extension identity that binds the user path /team/alpha, rather
than relying only on the raw X-GoModel-User-Path header. Keep the request
minimal while ensuring it exercises the documented fairness-ID behavior.

In `@internal/providers/config_test.go`:
- Around line 529-551: Convert TestApplyProviderEnvVars_LLMDControls into a
table-driven test covering both primary and suffixed LLMD providers. Set
LLMD_CANARY_FAIRNESS_FROM_USER_PATH, then assert each case’s provider name and
expected FairnessFromUserPath value, while preserving the existing
inference-objective and canary BaseURL assertions.

In `@internal/providers/llmd/llmd_test.go`:
- Around line 29-64: Update TestChatCompletionInjectsTrustedLLMDHeaders to use a
table-driven structure covering the relevant control-header and
provider-specific parameter-mapping cases. Capture the ChatCompletion response
and assert normalized ID, model, and assistant choice fields, while retaining
header assertions for each case; ensure the cases also verify response
normalization rather than only checking the error.

In `@internal/providers/llmd/llmd.go`:
- Around line 210-224: Update cloneWithoutControlHeaders to remove Authorization
and all client API-key or other credential-bearing headers while preserving
non-credential passthrough headers. Ensure both passthrough paths sanitize
headers before calling llmclient.DoPassthrough, retaining only the
gateway-generated authentication header, and add coverage verifying client
Authorization and API-key headers never reach the upstream server.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 40ba7a20-1704-44a8-93f9-8faebaa729ad

📥 Commits

Reviewing files that changed from the base of the PR and between aefa498 and 89a8874.

⛔ Files ignored due to path filters (2)
  • internal/admin/dashboard/static/dist/assets/index-DsX4Ww0Q.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (30)
  • .env.template
  • CLAUDE.md
  • README.md
  • config/config.example.yaml
  • config/config.go
  • config/config_test.go
  • config/providers.go
  • config/server.go
  • docs/advanced/config-yaml.mdx
  • docs/advanced/configuration.mdx
  • docs/docs.json
  • docs/features/passthrough-api.mdx
  • docs/providers/llmd.mdx
  • docs/providers/overview.mdx
  • helm/README.md
  • helm/templates/_helpers.tpl
  • helm/values.schema.json
  • helm/values.yaml
  • internal/providers/config.go
  • internal/providers/config_test.go
  • internal/providers/llmd/llmd.go
  • internal/providers/llmd/llmd_test.go
  • internal/providers/llmd/passthrough_semantics.go
  • internal/server/handlers_test.go
  • internal/server/passthrough_support.go
  • internal/usage/cost_test.go
  • run/providers.go
  • run/providers_test.go
  • web/dashboard/src/pages/overview/providersLogic.js
  • web/dashboard/tests/overview-providers.test.js

Comment thread docs/providers/llmd.mdx
Comment thread docs/providers/llmd.mdx
Comment thread internal/providers/config_test.go
Comment thread internal/providers/llmd/llmd_test.go
Comment thread internal/providers/llmd/llmd.go Outdated
@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

No blocking failure remains.

No accepted blocking findings remain after exercising llm-d passthrough control-header handling and authenticated user-path fairness behavior.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the llmd control-header review harness against an httptest upstream for router-root /tokenize and the compatible /v1/chat/completions paths, confirming that the upstream only saw the configured gateway credential and trusted objective/fairness metadata while caller-provided headers did not reach it.
  • Re-ran the harness with a client-asserted snapshot user path; no fairness ID was emitted, validating that the untrusted snapshot cannot inject a fairness identity.
  • Executed the focused llm-d provider regression tests and verified that passthrough callers cannot override trusted llm-d scheduling metadata or impersonate a fairness identity.
  • Compiled and posted a readiness note stating that llm-d scheduling metadata cannot be overridden by passthrough clients, based on the baseline and attacker-header tests and the client-snapshot checks.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

@SantiagoDePolonia

Copy link
Copy Markdown
Contributor Author

@greptile-apps Addressed the passthrough rejection-metadata finding in 6c47318. Normalized llmd 429 responses now preserve only X-Llm-D-Request-Dropped-Reason through the existing response-header error contract; arbitrary upstream headers such as X-Upstream and Set-Cookie remain filtered. Regression tests cover both /p/llmd/tokenize and /p/llmd/v1/chat/completions, plus raw provider responses on Router-root and /v1 paths.

# Conflicts:
#	.env.template
#	CLAUDE.md
#	README.md
#	config/config.example.yaml
#	config/config_test.go
#	config/server.go
#	docs/advanced/config-yaml.mdx
#	docs/advanced/configuration.mdx
#	docs/features/passthrough-api.mdx
#	docs/providers/overview.mdx
#	helm/README.md
#	helm/values.schema.json
#	helm/values.yaml
#	internal/admin/dashboard/static/dist/assets/index-CiIXCM_n.js
#	internal/admin/dashboard/static/dist/assets/index-DbvfJbHk.js
#	internal/admin/dashboard/static/dist/assets/index-DsX4Ww0Q.js
#	internal/admin/dashboard/static/dist/index.html
#	internal/providers/config_test.go
#	internal/server/handlers_test.go
#	internal/server/passthrough_support.go
#	internal/usage/cost_test.go
#	run/providers_test.go
#	web/dashboard/tests/overview-providers.test.js
@SantiagoDePolonia
SantiagoDePolonia merged commit c7eeb8a into main Aug 8, 2026
20 checks passed
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.

2 participants