Support for dynamically switching custom models during operation

Resolved 💬 3 comments Opened Oct 28, 2025 by africa1207 Closed Dec 6, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

Currently, I have customized the provider and model, but during usage, the /model endpoint always returns the hardcoded gpt-5 and gpt-5-codex, preventing dynamic retrieval of the custom models. To switch models, you have to exit codex and modify the configuration, or use codex -m my-model or -p, which is quite inconvenient. Additionally, when using the VS Code plugin, you must close and reopen VS Code for changes to take effect. Why can't the models be retrieved dynamically, and why isn't there a way to display these models dynamically within the VS Code plugin?

Additional information

It is possible to dynamically access custom models, switch between them in real-time via /model, and display these models within the VS Code plugin with seamless, real-time toggling.

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 10 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #4849
  • #4558
  • #5245
  • #4879

Powered by Codex Action

etraut-openai contributor · 8 months ago

Thanks for the feature request. This hasn't received any upvotes or additional posts, so I'm going to close it.

h3x89 · 4 months ago

I’m seeing a closely related problem in the Codex desktop app on macOS with a custom LiteLLM provider.

What works:

  • a custom LiteLLM-backed model can be added to model_catalog_json
  • the model becomes visible in /model and in the desktop GUI model picker
  • the same model works from CLI when I explicitly force the provider with config/profile overrides

What does not work:

  • selecting that model from the GUI or /model inside a session authenticated with a ChatGPT account does not switch the provider
  • Codex still appears to use the ChatGPT account path and returns:

The 'codex-glm-5' model is not supported when using Codex with a ChatGPT account.

So the model picker visibility works, but provider switching does not happen dynamically for custom providers.

This seems related to a few other reports:

  • #4558 (VS Code extension does not work with custom model provider)
  • #3860 (Dynamic profile switching + hot-reload for Codex CLI/IDE)
  • #5245 (/review ignores configured custom model / endpoint settings)

In my case the behavior is specifically:

  • custom model is visible
  • selection from the picker does not fully switch runtime to the custom provider
  • the request is still sent through the ChatGPT-account-backed path

Environment:

  • macOS desktop app
  • custom provider configured in ~/.codex/config.toml
  • model exposed via model_catalog_json
  • LiteLLM provider using OpenAI-compatible /v1/responses

If useful, I can provide a minimal repro config.