Skip to content

inference.LLM: add update_options for live model swaps#5757

Merged
theomonnom merged 4 commits into
mainfrom
feat/inference-llm-update-options
May 18, 2026
Merged

inference.LLM: add update_options for live model swaps#5757
theomonnom merged 4 commits into
mainfrom
feat/inference-llm-update-options

Conversation

@theomonnom
Copy link
Copy Markdown
Member

@theomonnom theomonnom commented May 18, 2026

No description provided.

The model id was previously only settable at construction time, so
demos that let a user pick a different LLM mid-session had to reach
into `llm._opts.model`. Add a public `update_options(model=...,
extra_kwargs=...)` method that mirrors `inference.STT.update_options`
/ `inference.TTS.update_options`. The new model id is read on the
next `chat()` call, so the swap lands on the agent's next turn
without recreating the LLM or losing the client connection pool.
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Théo Monnom seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@chenghao-mou chenghao-mou requested a review from a team May 18, 2026 03:21
devin-ai-integration[bot]

This comment was marked as resolved.

Per Devin review on #5757: dict.update() merge semantics meant a key
added via update_options could never be removed (even passing `{}`
was a no-op). Replace the dict outright so callers can swap or clear
the persistent kwargs cleanly. Consistent with the other update_options
implementations in the codebase (OpenAI TTS, Cartesia, Mistral, …).
@theomonnom theomonnom merged commit 7675da6 into main May 18, 2026
23 of 25 checks passed
@theomonnom theomonnom deleted the feat/inference-llm-update-options branch May 18, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants