Skip to content

refactor: remove custom base URL and resolve models on the server - #252

Merged
OndrejDrapalik merged 1 commit into
mainfrom
remove-custom-base-url
Oct 8, 2026
Merged

OndrejDrapalik merged 1 commit into
mainfrom
remove-custom-base-url

Conversation

@drankou

@drankou drankou commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Base URL setting removed: each provider's endpoint is now fixed in lib/models.ts. The Base URL field in the chat settings and NEXT_PUBLIC_NO_BASE_URL_INPUT are gone.
  • Ollama: reads its address from a new OLLAMA_BASE_URL env var. Ollama models are accepted only when it is set.
  • Models resolved on the server: /api/chat and /api/morph-chat look up the requested model ID in models.json and take the provider from there. Unknown IDs get a 400.
  • Only sampling parameters reach the AI SDK: the routes pass temperature, topP, topK, frequencyPenalty, presencePenalty and maxTokens by name instead of spreading the request config.
  • Tests: npm test runs new Node test-runner tests through the existing tsx dev dependency.

Behavior change

  • Custom endpoints: a self-hosted setup that pointed a provider at a different endpoint now changes it in lib/models.ts. A Base URL saved in the browser is ignored.

Screenshots

LLM settings menu on a local dev server.

Before After
Before After

Verification

  • npm test: 18 tests pass. Every provider calls its own host even when the request includes a baseURL, unknown models are rejected, and the routes forward only the sampling parameters. tsc and next build are clean.
  • Local dev server: /api/chat returns 400 for an unknown model and for an Ollama model when OLLAMA_BASE_URL is unset.

🤖 Generated with Claude Code

Provider endpoints are now fixed in lib/models.ts, and the Base URL
setting is gone from the chat settings. Ollama reads its address from
OLLAMA_BASE_URL and is only offered when that is set.

The chat routes look up the requested model in models.json and take the
provider from there, returning 400 for unknown models, and pass only the
sampling parameters through to the AI SDK.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cla-bot cla-bot Bot added the cla-signed label Oct 8, 2026
@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
fragments Ready Ready Preview Oct 8, 2026 11:58am UTC

Request Review

@drankou
drankou marked this pull request as ready for review October 8, 2026 12:00
@OndrejDrapalik
OndrejDrapalik merged commit 14ea9a2 into main Oct 8, 2026
8 checks passed
@OndrejDrapalik
OndrejDrapalik deleted the remove-custom-base-url branch October 8, 2026 12:08

This branch was successfully deployed

1 active deployment
Preview — dac3361e Deployed Oct 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants