Claude and Gemini removed; fork goes OpenAI-only

nipunbatra8 rips out both existing LLM backends in a single commit and replaces them with an OpenAI-only implementation. A large, sweeping rewrite that touches 20 files and deletes ~980 lines. Not a feature addition - a fork-direction decision.

infrastructureintegration

claude.ts and gemini.ts are deleted. A new openai.ts handles streaming chat and text completion against the Chat Completions API. The model list becomes gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, and o3. Frontend model-selection logic - ModelToggle.tsx, UserProfileContext.tsx, modelAvailability.ts - loses all provider-switching code.

Three things are broken in the resulting code. The per-user BYOK path is dead: getUserApiKeys returns {} and getUserModelSettings no longer selects any key column, so all calls fall back to process.env.OPENAI_API_KEY. The migration adds user_profiles.openai_api_key but nothing reads it. The o3 model option won't work - the implementation passes max_tokens and temperature, both of which o3 rejects (it requires max_completion_tokens and ignores temperature). Finally, provider-aware title model routing is replaced by a flat constant, removing the ability to run a cheaper model for title generation.

The standalone openai.ts streaming and tool-loop implementation is the one reusable artifact if you want OpenAI as an additional provider rather than a wholesale replacement.

So what Skip unless your fork is also dropping Claude and Gemini. The `openai.ts` streaming implementation is clean enough to borrow in isolation, but the broader migration has dead code and a broken model option that suggest it hasn't been fully tested end-to-end.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

1 commit from nipunbatra8/legalos, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
663c3130 migrate to openai nipunbatra8 2026-05-23 ↗ GitHub

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-563.md from inside the repo you want the changes in.

⬇ Download capture-thread-563.md