Skip to content

Add custom base URL support for AI providers - #19

Closed
fiandev wants to merge 2 commits into
LuxAlgo:mainfrom
fiandev:feat/custom-ai-provider
Closed

fiandev wants to merge 2 commits into
LuxAlgo:mainfrom
fiandev:feat/custom-ai-provider

Conversation

@fiandev

@fiandev fiandev commented Sep 23, 2026

Copy link
Copy Markdown

Allow configuring a custom OpenAI-compatible base URL for both Anthropic and OpenAI providers. URLs can be set per-provider and are validated (https/http only, max 2048 chars). Also render AskJournal AI responses as markdown.

Allow configuring a custom OpenAI-compatible base URL for both Anthropic
and OpenAI providers. URLs can be set per-provider and are validated
(https/http only, max 2048 chars). Also render AskJournal AI responses
as markdown.
@dzamwave

Copy link
Copy Markdown

Yes, this is a very important feature. I had to add it myself.

@jawand

jawand commented Oct 14, 2026

Copy link
Copy Markdown

@ChristopherDownie can we conclude this?

@ChristopherDownie

Copy link
Copy Markdown
Contributor

Hey @fiandev, thanks for kicking this off, and sorry it sat here for a bit! We ended up building it ourselves in a slightly different shape: instead of making the Anthropic/OpenAI base URLs editable in Settings (which could send a saved or env API key to any URL), we went with a separate OpenAI-compatible provider that has its own URL, model and optional key. It speaks Chat Completions, so Ollama, LM Studio and OpenRouter work out of the box, and proxies for the hosted providers go through the standard ANTHROPIC_BASE_URL / OPENAI_BASE_URL env vars.

You'll get credit in the changelog for proposing it. Closing this one out, thanks again! (And thanks @dzamwave and @jawand for the nudge.)

@ChristopherDownie

Copy link
Copy Markdown
Contributor

Quick follow-up: our version is up in #48, feel free to take a look.

winxdevop pushed a commit to winxdevop/trade-journal that referenced this pull request Oct 16, 2026
… models

Adds a third AI provider, "OpenAI-compatible", for Ollama, LM Studio,
OpenRouter, vLLM and other servers that speak the Chat Completions API.
It has its own server URL, model and optional encrypted key, and uses
@ai-sdk/openai-compatible, which never reads provider environment
variables, so ANTHROPIC_API_KEY / OPENAI_API_KEY are never sent to a
user-supplied URL. A saved key is bound to the URL it was saved with:
saving a different URL clears it unless a new key is sent.

Anthropic and OpenAI gateways keep working through the SDKs' standard
ANTHROPIC_BASE_URL / OPENAI_BASE_URL variables, now documented and
covered by a test. AI statement parsing stays on Anthropic and OpenAI,
which accept PDFs and strict structured output.

Replaces LuxAlgo#19; thanks to @fiandev for the proposal.
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.

4 participants