Skip to content

Fix external-provider ModelEndpoint example's double /v1 prefix#328

Merged
negz merged 1 commit into
modelplaneai:mainfrom
negz:prefix-and-prejudice
Jul 8, 2026
Merged

Fix external-provider ModelEndpoint example's double /v1 prefix#328
negz merged 1 commit into
modelplaneai:mainfrom
negz:prefix-and-prejudice

Conversation

@negz

@negz negz commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Description of your changes

Fixes #327

The "Route to External Providers" doc set rewritePath: /v1/ for a Together-backed ModelEndpoint. A ModelService's composed HTTPRoute only strips the /<namespace>/<service>/ prefix from the client's request path, leaving the client's own v1/... segment as the preserved remainder. Prepending /v1/ on top of that produces /v1/v1/..., which 404s against the backend, exactly as reported in #327.

rewritePath should replace only the namespace/service prefix, the same way the reference example for composed replicas already does (rewritePath: /ml-team/qwen-72b/, no added segment). This fixes the two copies of the Together example (docs/content/models/model-endpoint.md and the embedded docs/manifests/concepts/model-endpoint.yaml) to use rewritePath: /, so the client's v1/... passes through unchanged to Together's own /v1/... endpoint.

I have:

  • Read and followed Modelplane's contribution process.
  • Run nix flake check (or ./nix.sh flake check) and made sure it passes.
  • Added or updated tests covering any composition function changes.
  • Signed off every commit with git commit -s.

The "Route to External Providers" doc set rewritePath: /v1/ for a
Together-backed ModelEndpoint. A ModelService's HTTPRoute only strips
the /<namespace>/<service>/ prefix from the client's request, leaving
the client's own v1/... segment as the preserved remainder. Prepending
/v1/ on top of that produces /v1/v1/..., which 404s against the
backend.

rewritePath should replace only the namespace/service prefix, same as
the reference example for composed replicas (rewritePath:
/ml-team/qwen-72b/, no added segment). Set it to / here so the
client's v1/... passes through unchanged to Together's own /v1/...
endpoint.

Fixes modelplaneai#327.

Signed-off-by: Nic Cope <nicc@rk0n.org>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes the external-provider ModelEndpoint documentation example so that composed HTTPRoute path rewriting no longer produces a double /v1/v1/... prefix when clients call /<namespace>/<service>/v1/..., aligning the docs with the compose-model-service routing behavior.

Changes:

  • Update the Together external-provider example to use rewritePath: / (pass through the client’s v1/... segment unchanged).
  • Clarify the inline documentation comment explaining that only the /<namespace>/<service>/ prefix is stripped by the composed route.
  • Apply the same fix to both the rendered doc page and the embedded example manifest.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
docs/manifests/concepts/model-endpoint.yaml Fix example manifest to use rewritePath: / to avoid /v1/v1/... paths.
docs/content/models/model-endpoint.md Update the “Route to External Providers” example and commentary to match actual path-prefix stripping behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@negz negz added backport release-0.1 documentation Improvements or additions to documentation labels Jul 8, 2026
@negz negz merged commit 45fc199 into modelplaneai:main Jul 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release-0.1 documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: ModelEndpoint with rewritePath produces double-prefixed path when routed via ModelService

2 participants