Repository navigation
Replies: 1 comment 1 reply
|
Thanks for the proposal! I’m supportive of this direction. My thoughts on the questions:
|
|
Thanks for the proposal! I’m supportive of this direction. My thoughts on the questions:
|
Uh oh!
There was an error while loading. Please reload this page.
Hi all. I'd like to propose a chat model connection that stands for several deployments of the same model, with failover and a cooldown. I want to agree on the shape here before opening a PR.
Today
A chat model setup uses exactly one connection. When that endpoint is throttled or down, the call fails after its retries.
A
MODEL_ROUTERwithfallback(true)covers part of this with one setup per endpoint. But it keeps no memory between requests, so each request pays for the broken endpoint again. Routers also cannot be nested, so deployment failover and model routing have to share one router configuration. A connection group lets failover sit under model routing and quality escalation.#1324 proposes the LiteLLM Router for this in Python. LiteLLM has no Java SDK, so I think Java needs a native version. The two fit together: the same idea, LiteLLM in Python, this in Java.
A gateway in front (the LiteLLM proxy, Portkey) also does this. But it is one more service to run and keep available. This proposal is for jobs that call the providers directly.
How others do it
FailoverStrategy(experimental)These are related approaches with different failure and retry rules. LiteLLM does not cool a deployment down for most 4xx errors, and it can share the cooldown state through Redis. Envoy counts 5xx, timeouts and connection failures, and its retries are a route setting, apart from ejection. LangChain4j counts any error and keeps the state in memory.
LiteLLM also has the two layers this proposal ends up with: its sub-routers (auto, complexity) pick a model group, and the Router then spreads the call over the deployments of that group.
Proposal
Names are illustrative.
ReActAgentdo not change.modelfor that member. On Azure that is the deployment name. Native structured output is used only when every member supports it for the request.max-retriesstay as they are configured. A cancellation or an interrupt stops the call at once. A JVMErroris not failed over.PRIORITY,ROUND_ROBIN,WEIGHTED.@Experimental(inProgress = true), with the YAML type alias. No metrics in the first PR. The result metadata names the member that answered and the ones that failed.Questions
MODEL_ROUTER, where failover and model routing share one configuration.chat()(OpenAI and Anthropic twice by default). Failover is faster with member retries at 0. Should the group force that, or only document it and warn at plan build? I lean document.ChatModelConnectionGroup. Better ideas are welcome.References: LiteLLM routing, Envoy outlier detection, LangChain4j
FailoverStrategy.All reactions