Local model base_url not working
Resolved 💬 12 comments Opened Nov 22, 2025 by JimmyBenHur Closed Jun 12, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
codex-cli 0.63.0
What subscription do you have?
ChatGPT Plus
Which model were you using?
qwen3-coder-30b
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What issue are you seeing?
When using a local model with LM Studio, which I have hosted on a different PC in the same network, the base_url, which contains the IP adress of the other computer, is ignored. This is my config.toml:
model_provider="lmstudio"
model = "qwen3-coder-30b"
[model_providers.lmstudio]
name = "lmstudio"
base_url = "http://xxx.xxx.xx.xx:1234/v1"
[profiles.qwen3-coder-30b]
model_provider = "lmstudio"
model = "qwen/qwen3-coder-30b"
After the CLI fails to connect it shows this error: Connection failed: error sending request for url (http://localhost:1234/v1/responses), which means that it didn't use the IP from the base_url but the localhost URL.
What steps can reproduce the bug?
Host a local model in you local network on a different machine and do the config as above.
What is the expected behavior?
It is supposed to use the base_url, otherwise it is not able to connect, since the URL is false.
Additional information
_No response_
12 Comments
I'm also experiencing this issue. The last version that didn't have this issue is 0.58.0
i'm also having this issue. base_url in model config ignored
I can confirm this is happening on macOS after updating to
codex-cli v0.64.0.I'm running
qwen/qwen3-code-30bon LM Studio (localhost:1234) - macOS.My config explicitly omits
wire_api(which should default to "chat"), but the CLI is attempting to hit/v1/responses, which LM Studio doesn't support.Downgrading to v0.63.0 fixed the connection immediately, so this seems to be a regression in how v0.64.0 handles the default API wire format for local providers.
I see that there is a pull request which hasn't been merged, actually it was closed. Any updates on this? Really waiting for this fix.
Yeah, we're stuck back on 0.58.0 until this is fixed.
On Thu, Dec 4, 2025 at 3:02 PM Elias Kassebaum @.***>
wrote:
Also experiencing this issue on codex >= 0.59.0 on MacOS + Ubuntu 24.04. Downgrading to 0.58.0 fixed the issue.
I tried this on codex 0.66.0 and still encountering this. MacOS inference engine, Ubuntu 24.04 server running codex
Which
wire_apiare you using? We recommend usingwire_api = "responses". The latest versions of LM Studio support the responses API.We've announced that we're deprecating support in codex for the older "chat/completions" wire_api. Refer to this discussion thread for details.
I tried your
wire_apisuggestion, but nothing changes. It's the local network (IP) URL which causes the problems, since the localhost URL is always used.Closing as not planned. Please use a differently named custom provider or
CODEX_OSS_BASE_URLfor a non-local endpoint.@ax-openai Could you tell me what the intended setup is if I'm using an AI Gateway in Enterprise (for aggregated cost analysis/quotas across providers) and the Gateway lives in our internal network (10.0.0.0/8) please? It seems like there's no way to make Codex work if this is the case, is that right?