feat: add lossless inference proxy transport#47
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (7)
📝 WalkthroughWalkthroughMaple Proxy now routes OpenAI-compatible endpoints through a shared raw proxy handler, adds transport overrides for testing, preserves selected headers and responses, handles request and stream idle timeouts, narrows public APIs, and documents streaming and non-streaming support. ChangesOpenAI-compatible proxy flow
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant proxy_openai_request
participant InferenceTransport
Client->>proxy_openai_request: Send OpenAI-compatible request
proxy_openai_request->>InferenceTransport: Forward filtered request
InferenceTransport-->>proxy_openai_request: Return response or stream
proxy_openai_request-->>Client: Return filtered response
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Forward OpenAI-compatible inference requests through the raw OpenSecret transport, preserve provider-specific request and response data, harden the HTTP trust boundary, and remove the legacy typed Rust API for the 0.2.0 release.
a4e3629 to
40eadb0
Compare
Summary
Why
Maple Proxy previously deserialized inference requests through closed Rust types. That independently discarded provider-specific controls such as Gemma 4 chat_template_kwargs.enable_thinking even after fixing the SDK. The proxy now forwards caller-owned inference data through the SDK encrypted transport without becoming a schema authority.
The old public typed handlers were no longer used by create_app or Maple. Keeping them would preserve the lossy implementation as dead code, duplicate streaming and error behavior, and leave accidental crate internals as supported API.
HTTP contract and security
Intentional Rust API break
Version 0.2.0 removes the public proxy/config modules, typed endpoint handlers, proxy state, internal error types, and request-limit constant. The supported library embedding surface is:
The HTTP API remains compatible and is now more faithful to the OpenAI-compatible backend.
Package cleanup
Validation
Release order
After merge, publish maple-proxy 0.2.0. Maple will then resolve that registry release and complete the Gemma 4 no-thinking classifier PR.
Summary by CodeRabbit
[DONE]handling).