Cant use local openweights model through ollama + litellm in codex-cli
Resolved 💬 3 comments Opened May 9, 2026 by ACodingfreak Closed May 10, 2026
What version of Codex CLI is running?
codex-cli 0.130.0
What subscription do you have?
NA
Which model were you using?
openweights model /devstral:24b under ollama
What platform is your computer?
Ubuntu 22.04
What terminal emulator and version are you using (if applicable)?
_No response_
What issue are you seeing?
As shown below on running any requests I end up seeing a command to be executed but not the expected result
$ codex --profile remote
╭───────────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.130.0) │
│ │
│ model: ollama/devstral:24b /model to change │
│ directory: ~/workspace │
╰───────────────────────────────────────────────────╯
Tip: You can resume a previous conversation by running codex resume
› create a python file with logic to support singly linked list
⚠ Model metadata for `ollama/devstral:24b` not found. Defaulting to fallback metadata; this can degrade performance and cause issues.
• {"name": "exec_command", "arguments":{"cmd": "find /home/ipi/workspace -type f -name "*.py" | grep -i 'linked'", "justification": "", "login": true,
"max_output_tokens": 1000}}
What steps can reproduce the bug?
As mentioned in description. Find the respective cofnig file as shown below
cat ~/.codex/config.toml
model = "ollama/devstral:24b"
model_provider = "litellm_remote"
[model_providers.litellm_remote]
name = "Remote LiteLLM"
base_url = "http://10.30.0.103:4000/v1"
env_key = "LITELLM_API_KEY"
wire_api = "responses"
[profiles.remote]
model_provider = "litellm_remote"
model = "ollama/devstral:24b"
[projects."/home/ip/workspace"]
trust_level = "trusted"
[tui]
status_line = ["current-dir", "model", "project-name"]
status_line_use_colors = true
[tui.model_availability_nux]
"gpt-5.5" = 4
What is the expected behavior?
Ideally i should be able to use openweight models with codex-cli
Additional information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗