Repository navigation
Support runtime LLM model switching via server-side presets (per-bank/per-operation) #1140
eightHundreds
started this conversation in
Ideas
Replies: 1 comment 1 reply
|
you can set up an AI LLM gateway (litellm/openrouter or others) and do this config at proxy level, we're going to add an example in the next weeks |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I’m using Hindsight in a setup where different banks have different latency/cost requirements, and I wanted to switch the LLM model for a bank at runtime without restarting the server.
After tracing the current implementation, it looks like this is not supported today:
llm_provider/llm_modelas static fields and say provider/model selection “requires presets - not yet implemented”.ConfigResolver.update_bank_config()rejectsllm_modelbecause_CONFIGURABLE_FIELDSexcludes provider/model selection.update_bank_config(..., {"llm_model": "gpt-4"})raisesValueError.LLMProviderinstances are created up front.with_config()only applies Gemini safety settings, so even a resolved config would not currently swap the underlying model/provider per request.This means the current bank config API can change behavioral settings at runtime, but not the actual LLM provider/model.
There is also a small DX/documentation mismatch here: the HTTP/OpenAPI examples for
BankConfigUpdate/BankConfigResponsestill showllm_modelin the examples, which makes it look supported even though the implementation rejects it.Why this would help
Runtime model switching would be very useful for:
cheap-fastfor one bank,high-accuracyfor another)Proposed direction
The docs already hint at what seems like the right solution: presets.
Instead of making raw
llm_provider,llm_model,*_api_key,*_base_urlbank-configurable, Hindsight could support server-defined presets such as:{ "llm_preset": "fast-default", "retain_llm_preset": "cheap-extraction", "reflect_llm_preset": "high-quality-reasoning" }Where presets are configured server-side and map to provider/model/base_url/api-key bundles. Then banks could switch models at runtime safely without exposing credentials or arbitrary infrastructure details.
That seems like a good fit for the current security model:
resolve_full_config()Even if presets are not implemented soon
At minimum, it would help to align the API examples/OpenAPI examples with the actual behavior so
llm_modelis not shown as a valid bank-config override.Curious if this is already on the roadmap. If not, I’d love to see preset-based runtime model switching added.
All reactions