Replies: 3 comments 1 reply
|
Re the open question — "what is the failure mode when a session with MoM loses semantic routing state while still engaging in turns?" — the failure is silent today: the session bounces tiers mid-conversation and nobody notices until a user complains (this is essentially vllm-project/semantic-router#1439, which I reported there). I have been sketching a complementary piece for exactly this: an async quality-sampling filter at the gateway that sends a small sample of (request + response) pairs — session-level for multi-turn traffic — to a strong judge model outside the request path, and emits per-route/per-model quality scores as metrics. With that in place, a lost-affinity failure shows up as a score drop on the affected route instead of an anecdote, with zero added latency on the hot path. The same data has a second use that seems relevant here: Switchyard's config knobs ( I think the two compose cleanly: this proposal decides where requests go, the sampling layer measures whether those decisions are holding. Will write it up as its own discussion shortly. |
|
Thank you for the analysis on this, and the proposition. Maintainer +1 I'm in favor of someone building a POC of this in https://github.com/praxis-proxy/experimental as a next step to start exploring further. |
|
This comment was posted by Opus 4.8 on behalf of @usize. Following up on the maintainer +1: this is now being carried forward in praxis-proxy/experimental —
Both hang off Track A of the Standalone AI Gateway MVP epic (ai#758). Two answers to the open questions above, from reading Switchyard v0.2.0: (a) no model shipping needed — the classifier/judge is an ordinary |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
NVIDIA released NeMo Switchyard on August 11 as a model routing library. The discussion in #838 and the semantic routing section of ai#74 describe the same problem space from the Praxis side. After looking at Switchyard's architecture I think there's a clean integration path that avoids reinventing the routing algorithms while keeping the classifier-as-black-box approach that I outlined in the #838 discussion.
What Switchyard Is (and Isn't)
Switchyard is a routing decision library, not a gateway. Its crate
switchyard-libsynever makes HTTP calls itself. It yields a stream ofStepenums:The host owns the HTTP stack, credentials, connection pool, and retry policy. The library just says "call this model" and "here's my routing decision."
Switchyard ships four routing algorithms:
It also handles protocol translation (OpenAI Chat, OpenAI Responses, Anthropic Messages), but Praxis already does this with deeper coverage.
Why This Maps to a Praxis Filter
The
Step::CallModelpattern maps directly toSubRequestClient. A filter would:BodyMode::StreamBufferto peek at the request envelopeswitchyard-protocolrequest from the classified bodyStep::CallModelinstructions viaSubRequestClient(sharing the server-level connection pool)ctx.filter_metadataorctx.clusterThis is structurally identical to what
ai_guardrailsalready does: StreamBuffer peek, external callout via SubRequestClient, routing decision based on the result.The filter would sit in the
classify -> validate and select -> rewritepipeline that #838 converged on. The algorithm's routing decision maps to a well-known header or metadata key that downstream filters (like the proposedmodel_rewrite, see praxis-proxy/ai#643) can consume.What Praxis Gets
What Praxis Keeps
Everything that Switchyard doesn't do, which is most of what an AI gateway does:
Importantly, we can continue to work with llm-d on their own proposed semantic classification project, which will now have a clear counterpart and thus an API shape to work from.
Integration Shape
The dependency would be on
switchyard-libsyandswitchyard-protocolonly. No need forswitchyard-serveror any of the proxy infrastructure. These are pure Rust crates with a Tokio async interface.The filter configuration would map Switchyard's TOML concepts (targets, tiers, thresholds) into Praxis YAML:
Caveats
switchyard-protocoltypes overlap with types inpraxis-ai-apis. A thin translation layer between the two type systems would be needed. This is straightforward -- both represent the same OpenAI/Anthropic wire formats.Questions
References
libsycrate docsAll reactions