Skip to content

feat: Pass through /v1/embeddings and serve GET /v1/models/{model}. - #430

Merged
franciscojavierarceo merged 3 commits into
vllm-project:mainfrom
Mohammad-nassar10:feat/embeddings-passthrough
Oct 10, 2026
Merged

franciscojavierarceo merged 3 commits into
vllm-project:mainfrom
Mohammad-nassar10:feat/embeddings-passthrough

Conversation

@Mohammad-nassar10

@Mohammad-nassar10 Mohammad-nassar10 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

First part of #404, the audio routes follow in a separate PR.

  • POST /v1/embeddings is forwarded to the upstream unchanged, through the same pass-through helper as Chat Completions (moved to handler/common.rs so the routes share it).
  • GET /v1/models/{model} returns the matching entry from the upstream /v1/models list. vLLM has no per-model route, so a plain forward would always return 404 (happy to switch if you prefer). Unlisted models get 404 model_not_found, upstream errors are returned unchanged, and IDs containing / work encoded or not.
  • Both routes use the same auth and body-size limit as the other /v1/* routes. README and API docs updated.

Test Plan

  • New embeddings_passthrough_test.rs; retrieval tests added to models_test.rs; unit tests for the model lookup.
  • cargo fmt -- --check, cargo clippy --all-targets -- -D warnings and cargo test -p agentic-server pass.

Refs #404.

@Mohammad-nassar10 Mohammad-nassar10 changed the title Pass through /v1/embeddings. Pass through /v1/embeddings and serve GET /v1/models/{model}. Oct 10, 2026
@franciscojavierarceo
franciscojavierarceo requested a balanced review from Copilot October 10, 2026 00:12

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.

🟡 Changes recommended

Model retrieval drops upstream metadata headers and its OpenAPI success response lacks a body schema.

2 open findings
What changed in this PR

Adds embeddings passthrough and single-model retrieval to the HTTP gateway.

Changes:

  • Proxies POST /v1/embeddings.
  • Serves GET /v1/models/{model} from the upstream model list.
  • Adds documentation, OpenAPI registration, authentication checks, and integration tests.
File Description
README.md Lists the new endpoints.
docs/​api/​index.md Documents passthrough and model retrieval behavior.
crates/​agentic-server/​tests/​oidc_auth_test.rs Verifies endpoint authentication.
crates/​agentic-server/​tests/​models_test.rs Tests model lookup and errors.
crates/​agentic-server/​tests/​embeddings_passthrough_test.rs Tests embeddings passthrough and limits.
crates/​agentic-server/​src/​openapi.rs Registers the new OpenAPI paths.
crates/​agentic-server/​src/​handler/​mod.rs Re-exports new handlers.
crates/​agentic-server/​src/​handler/​http/​models.rs Implements model retrieval.
crates/​agentic-server/​src/​handler/​http/​mod.rs Registers HTTP handler modules.
crates/​agentic-server/​src/​handler/​http/​embeddings.rs Implements embeddings passthrough.
crates/​agentic-server/​src/​handler/​http/​chat_completions.rs Reuses the shared passthrough helper.
crates/​agentic-server/​src/​handler/​common.rs Centralizes passthrough behavior.
crates/​agentic-server/​src/​app.rs Adds routes to the protected router.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Mohammad-nassar10 Mohammad-nassar10 changed the title Pass through /v1/embeddings and serve GET /v1/models/{model}. feat: Pass through /v1/embeddings and serve GET /v1/models/{model}. Oct 10, 2026
@franciscojavierarceo
franciscojavierarceo merged commit 0714405 into vllm-project:main Oct 10, 2026
16 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.

3 participants