feat: Pass through /v1/embeddings and serve GET /v1/models/{model}. #430
The successful lookup drops every header from the upstream /v1/models response, including request IDs and rate-limit metadata for the request the gateway just made. This repository’s transformed-response contract preserves those headers while removing stale representation headers (crates/agentic-server-core/src/proxy.rs:181-192). Retain the upstream header map here, remove content-length/content-encoding, and replace content-type for the extracted object.
The new OpenAPI operation declares a description but no 200 response body/content, so generated clients model successful retrieval as an empty response even though the handler returns a model object. Declare the existing ModelObject schema here (and ideally assert this path’s response schema in the OpenAPI test).
<!-- ccr-overview-v2 -->
🟡 Changes recommended
Model retrieval drops upstream metadata headers and its OpenAPI success response lacks a body schema.
<details open>
<summary><strong>2 open findings</strong></summary>
</details>
<details>
<summary><strong>What changed in this PR</strong></summary>
Adds embeddings passthrough and single-model retrieval to the HTTP gateway.
Changes:
POST /v1/embeddings.GET /v1/models/{model} from the upstream model list.| 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. |
</details>
🧠 Review effort: Balanced
---
💡 <a href="/vllm-project/agentic-api/new/main?filename=.github/skills/code-review/SKILL.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add a code-review agent skill</a> or configure MCP servers for context-aware, tailored reviews. <a href="https://docs.github.com/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review?tool=webui#mcp-servers-and-agent-skills" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn more in the docs.</a>
Fixed, Applied with processed_response_headers instead of removing the headers by hand.
Fixed.
Approved these changes.
franciscojavierarceo
Mohammad-nassar10
Summary
First part of #404, the audio routes follow in a separate PR.
POST /v1/embeddingsis forwarded to the upstream unchanged, through the same pass-through helper as Chat Completions (moved tohandler/common.rsso the routes share it).GET /v1/models/{model}returns the matching entry from the upstream/v1/modelslist. vLLM has no per-model route, so a plain forward would always return 404 (happy to switch if you prefer). Unlisted models get 404model_not_found, upstream errors are returned unchanged, and IDs containing/work encoded or not./v1/*routes. README and API docs updated.Test Plan
embeddings_passthrough_test.rs; retrieval tests added tomodels_test.rs; unit tests for the model lookup.cargo fmt -- --check,cargo clippy --all-targets -- -D warningsandcargo test -p agentic-serverpass.Refs #404.