Skip to content

Support user-provided AI providers and ChatGPT plans - #63

Merged
satyalyadav merged 12 commits into
code-lab-org:mainfrom
darthvader58:user-ai
Nov 6, 2026
Merged

satyalyadav merged 12 commits into
code-lab-org:mainfrom
darthvader58:user-ai

Conversation

@darthvader58

@darthvader58 darthvader58 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #24

People can now use TATC AI without ASU credentials or a VPN, by adding their own API key or, on a local install, connecting a ChatGPT plan. ASU Voyager and CreateAI stay available.

What changed

  • Your own API keys: OpenAI, Anthropic, Google, and OpenRouter models, with keys added per user under Settings > Data & Privacy > Provider API keys. This uses LibreChat's encrypted user_provided storage, on both local and deployed stacks.
  • ChatGPT plan, local only: new apps/chatgpt-bridge service using OpenAI's Sign in with ChatGPT for locally hosted open-source apps. It holds the OAuth tokens and translates LibreChat's Chat Completions requests into the Responses requests the plan route requires. OpenAI requires an interest form for hosted apps, so the deploy stack leaves it out.
  • Connect from the app: on local installs, a ChatGPT plan button in the header shows the connection, starts sign-in in a new tab, and saves the key to the current account in one click.
  • Clear routing and billing: every model label names its provider or says "Using ChatGPT plan". There is no provider fallback, and failures show the provider's error.
  • Docs: docs/providers.md covers setup, eligibility, limits, billing, and which steps need the VPN.

Verification

Done with a real ChatGPT plan, in the real LibreChat UI:

  • Sign-in, consent, and token exchange. Satellite search, metadata, and an interactive ground track map, all with GPT-6.1 Sol through real MCP tools.
  • Connecting from the in-app panel with no key pasted, then a real reply. Tested on 127.0.0.1:3080; localhost:3080 was checked at the status endpoint only.

Done in the real LibreChat UI (v0.8.7), using test accounts:

  • Tool calling, title generation, and the wrong-key, usage-limit, mid-stream failure, and cut-off stream errors, through the real bridge against a local fake Responses API.
  • A second account with no key gets "No key found".
  • Fake keys reach OpenAI, Anthropic, Google, and OpenRouter, and each provider's auth error is shown.
  • ASU Voyager with a real key, a real MCP tool call, and a title, with no VPN connected.
  • With placeholder ASU keys, Voyager shows a clear 401.
  • 48 bridge unit tests pass.

Not done yet:

  • Token refresh and disconnect against OpenAI's live service, and the usage-limit error from a real limit. These are covered by unit tests and the fake API only.
  • Opening the Study pane and running a study on the merged code. Its script and button load.
  • A successful chat and tool call (search, metadata, ground tracks, maps) with a valid OpenAI, Anthropic, Google, and OpenRouter key. No valid keys were available or no credits available on those API keys to test properly on.
  • The deploy stack was not run; only its config changed.

Existing issues found, not changed here

  • CreateAI Claude Haiku 4.5 fails with empty_messages before any request is sent, because LibreChat assumes a small context window and the tool definitions use about 44k tokens. Other model specs that LibreChat does not recognize may need maxContextTokens too. Might want to check on this ^
  • LibreChat's Provider API keys dialog apparently says "Your key will never expire" before any key is saved. (very minor but strange indeed)

@darthvader58
darthvader58 marked this pull request as ready for review November 4, 2026 22:45
@satyalyadav

satyalyadav commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Two fixes needed before merging:

  1. OpenAI API-key tool calls fail with HTTP 400 using the current presets. Switching to the Responses API worked in testing. Please update the presets.
  2. Claude Opus 5.5 title generation sends thinking: disabled, which that model rejects. Please use compatible title settings or a compatible title model. This was checked with a strict simulation, not a live Claude key.

@satyalyadav
satyalyadav merged commit acb3a11 into code-lab-org:main Nov 6, 2026
2 checks passed
@darthvader58
darthvader58 deleted the user-ai branch November 8, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support user-provided AI providers while preserving ASU integrations

2 participants