npolevara

npolevara

Hi everyone!

This is my first public Elixir repo, so I’d really appreciate any feedback.

The background: I have a Codex subscription that I wanted to reuse across different tools — both my own scripts and third-party apps. The main obstacle was always the same: most of those tools just want to point at an OpenAI-compatible endpoint with an API key, and there was no clean way to put my Codex subscription behind one.

CodexRiver is my answer to that. It’s a standalone Elixir/OTP application that speaks the OpenAI API and delegates generation to a local codex app-server process. A few design choices I ended up liking:

  • No frontend and no web framework — HTTP/1.1 is served directly over :gen_tcp.
  • Routes: GET /health, GET /v1/models, POST /v1/chat/completions (JSON, SSE streaming, and function tools), and POST /v1/responses.
  • Auth is by bearer token. Each API key gets its own supervised client and its own codex app-server process, and every request starts a fresh ephemeral thread — so different keys can’t share hidden Codex context, and requests don’t leak into your Codex history. The raw key is never used as a process name or written to logs.
  • It ships as a single-file Burrito executable (macOS/Linux/Windows targets), so the target machine only needs the codex binary and its credentials, not an Elixir toolchain.

Right now I’m using it successfully with Zed (generating PR text, open code review) and natively from the Warp console.

Repo: GitHub - npolevara/river: a pipe from binary to api · GitHub

It’s early (3 commits, zero stars :slightly_smiling_face:), so I’d love comments, critique, and suggestions — especially on the raw :gen_tcp HTTP handling and the per-key supervision/isolation design. Happy to answer any questions!

Where Next? Top

Trending in AI / LLMs Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
AstonJ
With advancements in AI gathering pace and set to increasingly accelerate, perhaps it’s worth having an annual thread on the topic - feel...
New
dmitriid
What A larger rant at in this post. Code at github: GitHub - dmitriid/llamex: Credo Plugin that detects issues that LLM-assisted Elixir r...
New
brightball
Posting this more for general discussion, but does anybody have a need for a stock CMS anymore? I’ve built 3 different sites using Elixi...
New

Other Trending Topics Top

raa-ziq
Hi everyone :waving_hand: I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
gtcode
Aloha gang, There’s a new class of AI model out from TypeSafe. Jev is their flagship model. You can learn about it here: ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews