You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’d love to be able to use Codex locally, for example to ask it questions about my system, my server, and everything I have on my computer, without necessarily having to go through your servers.
That would be really cool and would give everyone the opportunity to have full control over their own data.
Reacted by Ryan Gregg, Gianluca Andretta, Francisco Schulz, Brian Lovin, Mark McNally, Zhiyuan Xu, Raul Perțe, Bruno Mulinari, ghchris2021, Raahel Baig and 103 more
Reacted by v1ckxy, 1zilc, Deepak Suthar, bearworks, Miguel de Sousa, David Ryan, Dahai Peng, Davide Bolzoni and sivam1netapp
Reacted by Sam, sivam1netapp and visualies
Reacted by Flavio Adamo, Gianluca Andretta, ghchris2021, Raahel Baig, Pl8tinium, Kush Gupta, Younes, Kelvin, Yukai Huang, v1ckxy and 23 more
The current logic supports the openai sdk, but we are excited to review contributions that would decouple this if done without introducing significant complexity to the project.
Some parts about the code patch format that the model is expected to generate are quite specific to the openai models as we have seen this improve general accuracy and model performance, and so at the moment this isn't a trivial refactor and change.
Reacted by ghchris2021, strawberrymelonpanda, DNF34, Agusti F., Mathias Schindler, Suyog Sonwalkar, Chris, Edemir Santos de Paula, Raul Perțe, Midnight and 4 more
This project is currently using the /responses endpoint from OpenAI's API. Ollama has compatibility with some OpenAI API endpoints, but the /responses endpoint is not included yet. If Ollama supported this endpoint, we could simply update the OPENAI_BASE_URL variable (defined here) to point directly to the Ollama URL.
I've opened an issue in the Ollama repository about this
Reacted by num13ru, Sam Reid, Ilya Chidyakin, Yukai Huang, Moritz Gnisia, Kenwwww, Fernando, Yaroslav Voropaev, Tim Jünemann, Sean Flanigan and 21 more
Would the maintainers be open to adding a lightweight LLMProvider abstraction in the CLI? The idea is to decouple transport from prompt/patch logic, so you could plug in OpenAI, Ollama (or any other backend).
All you have to do is set OPENAI_BASE_URL to your local LiteLLM proxy and then you can set OPENAI_API_KEY to your LiteLLM proxy key.
Voila, you can configure any model you want from any provider that supports Responses API (currently only directly to OpenAI, but should be available for other providers soon) and codex works!
Reacted by Cash Williams, Ishaan Jaff, Martin Stankard, Glenn 'devalias' Grant, berke tezgocen and buhuipao
Hey everyone, I am currently trying to use a self hosted deepseek model within codex, so I have set myself up with a devcontainer containing everything i need (node, npm, litellm, openai, ... ). If this issue is to litellm related for this thread I am sorry.
our model can only be reached with a certificate. I have added the cert file within the container, so that it is possible for me to curl for a response from litellm like this:
I am able to receive answers form this endpoint. Here comes the codex related problem:
remember the base_url and api_key are already set. I run the following command: codex --provider openai --model deepseek-70b -q "what is 2+2?"
i receive:
codex --provider openai --model deepseek-70b -q "what is 2+2?" {"role":"user","content":[{"type":"input_text","text":"what is 2+2?"}],"type":"message"} {"id":"error-1745578428541","type":"message","role":"system","content":[{"type":"input_text","text":"⚠️ OpenAI rejected the request. Error details: Status: 404, Code: 404, Type: unknown, Message: 404 litellm.NotFoundError: NotFoundError: OpenAIException - {\"detail\":\"Not Found\"}. Please verify your settings and try again."}]}
on my litellm side of things i receive this error: httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://10.244.192.53:30000/v1/responses' For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404 litellm.llms.base_llm.chat.transformation.BaseLLMException: {"detail":"Not Found"} litellm.exceptions.NotFoundError: litellm.NotFoundError: NotFoundError: OpenAIException - {"detail":"Not Found"}
the question is "why is codex looking for /responses endpoint?" can i somehow provide that?
looks like litellm would have to allow for the new /responses endpoint. We may have to wait for an update or fix it ourselves....In the meantime, I'll look at the endpoint call functions and see how difficult that would be to add another endpoint
There is experimental support for /responses endpoint in a litellm release on this issue
There is also discussion pertaining to responses api in the vllm issue here
I would like pointers on how I can retroactively patch either or both layers to support codex, in the event this proves counterintuitive and the recommended way forward is to try and use /v1/responses I am very hesitant that effort spent there is basically useless because even if support lands in vllm I don't think it'll be trivial to finetune any B parameter models to work easily with /v1/responses because I am naively suspecting that the interfaces would have to be trained significantly by some big player with GPUs before it becomes effective again accross open source's definition of "open ai compatible api endpoint" (this is probably very naive, and potentially wrong, maybe vllm internally does all the logit stuff at a more granular level and the differences in /v1/responses and /v1/chat/completions is only cosmetic and purely app layer)
I am very interested and keen on seeing this through and would like any pointers to get me started on the right angle of approach
Here's the set up for custom/local providers you need that support the (regular) OpenAI Completion API (not responses):
Define your provider in ~/.codex/config.json
export the provider_API_KEY env
Change the OPENAI_BASE_URL env
Reacted by theycallmeloki, Nils Baierl, Ori Nachum, Jamie Gardner, Changemyminds, meowtech, Petar Dobrev, Kameron Tanseli, jeorji, Jordan Carson and 2 more
The latest commit fixes a compile-level omission found during self-audit by adding the TUI guard's missing ActivePermissionProfile and :danger-full-access imports.
Current validation: static source/diff audit PASS; native Windows runtime NOT_PROVEN; no GitHub Actions run was visible yet for the exact latest commit.
Activity
tibo-openai commentedon Apr 16, 2025
The current logic supports the openai sdk, but we are excited to review contributions that would decouple this if done without introducing significant complexity to the project.
Some parts about the code patch format that the model is expected to generate are quite specific to the openai models as we have seen this improve general accuracy and model performance, and so at the moment this isn't a trivial refactor and change.
imggion commentedon Apr 16, 2025
@tibo-openai I’d be very happy to find a way to introduce this without making the project too complex.
nannan-motorq commentedon Apr 16, 2025
Will there be support for Azure OpenAI? I don’t see an option to set a custom endpoint. This would be a great addition for enterprise use
Pl8tinium commentedon Apr 16, 2025
i knew this would be the very first question people will be asking 😁
KorigamiK commentedon Apr 16, 2025
There doesn't seem to be any as far as I can see
#14 (comment)
[-]Required API Key - Is there any way to use it with a local LLM?[/-][+]Using with local LLM?[/+]vmotta8 commentedon Apr 17, 2025
This project is currently using the /responses endpoint from OpenAI's API. Ollama has compatibility with some OpenAI API endpoints, but the /responses endpoint is not included yet. If Ollama supported this endpoint, we could simply update the OPENAI_BASE_URL variable (defined here) to point directly to the Ollama URL.
I've opened an issue in the Ollama repository about this
rjxby commentedon Apr 17, 2025
Hi all,
Would the maintainers be open to adding a lightweight LLMProvider abstraction in the CLI? The idea is to decouple transport from prompt/patch logic, so you could plug in OpenAI, Ollama (or any other backend).
E.g., an interface:
interface LLMProvider {
complete(prompt: string, opts: any): Promise;
}
and two simple adapters (OpenAIProvider for /responses, OllamaProvider for /completions + wrap). Defaults remain on OpenAI.
This keeps the CLI flexible for local/offline models while preserving existing behavior. Curious if this aligns with the repo’s roadmap - thanks!
SawyerHood commentedon Apr 17, 2025
I just found this fork which uses the completions api to work with gemini! It could probably work with ollama as well https://github.com/ymichael/codex
marty-sullivan commentedon Apr 17, 2025
The best current way to do this is to use LiteLLM Proxy. You can quickly spin one up locally.
https://docs.litellm.ai/docs/simple_proxy
All you have to do is set
OPENAI_BASE_URLto your local LiteLLM proxy and then you can setOPENAI_API_KEYto your LiteLLM proxy key.Voila, you can configure any model you want from any provider that supports Responses API (currently only directly to OpenAI, but should be available for other providers soon) and codex works!
DuinoDu commentedon Apr 17, 2025
Is that possible to set
BASE_URLin https://github.com/openai/codex/blob/main/codex-cli/src/utils/agent/agent-loop.ts#L255tcztzy commentedon Apr 17, 2025
marty-sullivan commentedon Apr 17, 2025
@tcztzy They have implemented Responses API already, it is just not supported for all providers yet. They are adding Azure support this week:
BerriAI/litellm#9653 (comment)
Appreciate the downvote though.
mrmartin commentedon Apr 17, 2025
https://github.com/mudler/LocalAI lets you host local LLMs with /v1/responses
Can't wait to try it out!
29 remaining items
MSDimos commentedon Apr 21, 2025
It seesm like codex has supported DeepSeek already?
It works for me like below:
I didn't set
OPENAI_API_KEY, on the contrary, I setDEEPSEEK_API_KEY, and it indeed works properly.nb0309 commentedon Apr 21, 2025
@MSDimos how did you change the model name for the codex, I have set the api for DEEPSEEK_API_KEY yet the model hasn't changed
MSDimos commentedon Apr 21, 2025
@nb0309
If it doesn't work, try to update to the latest version. There is still a lot of work for improvement in the code support for deepseek.
Cachet23 commentedon Apr 25, 2025
Hey everyone, I am currently trying to use a self hosted deepseek model within codex, so I have set myself up with a devcontainer containing everything i need (node, npm, litellm, openai, ... ). If this issue is to litellm related for this thread I am sorry.
i have configured litellm like that:
in devcontainer.json:
our model can only be reached with a certificate. I have added the cert file within the container, so that it is possible for me to curl for a response from litellm like this:
curl -v -H "Authorization: Bearer sk-test" -H "Content-Type: application/json" -d '{"model":"deepseek-70b","messages":[{"role":"user","content":"2+2"}]}' http://localhost:4000/v1/chat/completionsI am able to receive answers form this endpoint. Here comes the codex related problem:
remember the base_url and api_key are already set. I run the following command:
codex --provider openai --model deepseek-70b -q "what is 2+2?"i receive:
codex --provider openai --model deepseek-70b -q "what is 2+2?" {"role":"user","content":[{"type":"input_text","text":"what is 2+2?"}],"type":"message"} {"id":"error-1745578428541","type":"message","role":"system","content":[{"type":"input_text","text":"⚠️ OpenAI rejected the request. Error details: Status: 404, Code: 404, Type: unknown, Message: 404 litellm.NotFoundError: NotFoundError: OpenAIException - {\"detail\":\"Not Found\"}. Please verify your settings and try again."}]}on my litellm side of things i receive this error:
httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://10.244.192.53:30000/v1/responses' For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404litellm.llms.base_llm.chat.transformation.BaseLLMException: {"detail":"Not Found"}litellm.exceptions.NotFoundError: litellm.NotFoundError: NotFoundError: OpenAIException - {"detail":"Not Found"}the question is "why is codex looking for /responses endpoint?" can i somehow provide that?
gyasis commentedon May 2, 2025
looks like litellm would have to allow for the new /responses endpoint. We may have to wait for an update or fix it ourselves....In the meantime, I'll look at the endpoint call functions and see how difficult that would be to add another endpoint
theycallmeloki commentedon May 2, 2025
There is experimental support for
/responsesendpoint in a litellm release on this issueThere is also discussion pertaining to responses api in the vllm issue here
I would like pointers on how I can retroactively patch either or both layers to support codex, in the event this proves counterintuitive and the recommended way forward is to try and use
/v1/responsesI am very hesitant that effort spent there is basically useless because even if support lands in vllm I don't think it'll be trivial to finetune any B parameter models to work easily with /v1/responses because I am naively suspecting that the interfaces would have to be trained significantly by some big player with GPUs before it becomes effective again accross open source's definition of "open ai compatible api endpoint" (this is probably very naive, and potentially wrong, maybe vllm internally does all the logit stuff at a more granular level and the differences in /v1/responses and /v1/chat/completions is only cosmetic and purely app layer)I am very interested and keen on seeing this through and would like any pointers to get me started on the right angle of approach
dnakov commentedon May 2, 2025
Here's the set up for custom/local providers you need that support the (regular) OpenAI Completion API (not responses):
OriNachum commentedon May 14, 2025
@dnakov how is state managed?
(And what about responses features, like web search, and upcoming MCP support?)
dnakov commentedon May 14, 2025
Just a pretty basic map:
https://github.com/openai/codex/blob/main/codex-cli/src/utils/responses.ts#L165
I haven't tried web search, but it should work as its just defined as a tool call
OriNachum commentedon May 14, 2025
It's worth noting that I wrote a middleware with state management. (So you work with responses and it operates any Chat Completions AI Provider)
https://github.com/teabranch/open-responses-server
I'm about to finish adding MCPs support.
chore(todo): add items 26-27 — phase 4 z+aa plan and post-x+y docs sweep
Keep cold supervisor wakes off client clocks (#26)
fix(gui): migrate composer drafts to paragraph model (openai#26)
fscfede-beep commentedon Sep 19, 2026
Final reconciliation update for the current patch series:
Latest commit:
599fe2f861aed2041a62bacfa0dde2786799a689Compare vs isolated upstream baseline: 9 ahead / 0 behind.
The latest commit fixes a compile-level omission found during self-audit by adding the TUI guard's missing
ActivePermissionProfileand:danger-full-accessimports.Evidence report:
SHA-256
d1a3a5829d79264ff4a162c45eedfe8c41742c1069637b00cb74664365836ab6Current validation: static source/diff audit PASS; native Windows runtime NOT_PROVEN; no GitHub Actions run was visible yet for the exact latest commit.