Allow --oss / --local-provider to use user-defined [model_providers] entries

Open Beginner friendly
#62,168 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Start with codex-rs/config/src/config_toml.rs and trace validate_oss_provider, ensure_oss_provider_ready, and get_default_model_for_oss_provider; check the related tests and how user-defined [model_providers.<id>] entries are loaded. Confirm --oss --local-provider <id> accepts a configured provider while readiness checks and default model behavior remain as described. Done when the issue’s proposed cases are covered by tests.

Written by the indexing model from the issue text.

Description

CLI config custom-model enhancement
What variant of Codex are you using?

CLI

What feature would you like to see?

Let --oss / --local-provider (and oss_provider in config.toml) accept any provider ID that the user has defined under [model_providers.<id>], not only lmstudio and ollama.

Today validate_oss_provider (codex-rs/config/src/config_toml.rs) rejects every other ID with Invalid OSS provider '<id>'. Must be one of: lmstudio, ollama. A user who runs a different local OpenAI-compatible server can already reach it through a custom [model_providers.*] entry plus model_provider = "<id>", but cannot use the --oss flow for it.

Proposed behavior:

  • codex --oss --local-provider <id> accepts <id> when [model_providers.<id>] exists in the user's config.
  • The built-in readiness checks in ensure_oss_provider_ready stay specific to lmstudio and ollama; for user-defined providers, Codex skips setup, as it already does for unknown IDs.
  • get_default_model_for_oss_provider returns None for user-defined providers, so the user's configured model is used.

This would cover requests for individual local runtimes without Codex having to maintain each one, for example #47189 (osaurus).

Additional information

I maintain Rapid-MLX, an open-source OpenAI-compatible inference server for Apple Silicon, so I'm one of the runtimes that would use this. A config that works today without --oss:

model_provider = "rapid-mlx"
model = "qwen3.8-27b-4bit"

[model_providers.rapid-mlx]
name = "Rapid-MLX"
base_url = "http://127.0.0.1:8000/v1"

With this change, codex --oss --local-provider rapid-mlx would work with the same entry.

Dominant language
Rust
Stars
136k
Forks
21.5k
Avg merge
1m
Merged PRs (30d)
998

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.