You can use Codex with any endpoint compatible with OpenAI Response API[1], like llama.cpp.
[1]: https://unsloth.ai/docs/basics/codex