Repository navigation
refactor: remove custom base URL and resolve models on the server - #252
Merged
Merged
Conversation
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]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
drankou
marked this pull request as ready for review
October 8, 2026 12:00
OndrejDrapalik
approved these changes
Oct 8, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lib/models.ts. The Base URL field in the chat settings andNEXT_PUBLIC_NO_BASE_URL_INPUTare gone.OLLAMA_BASE_URLenv var. Ollama models are accepted only when it is set./api/chatand/api/morph-chatlook up the requested model ID inmodels.jsonand take the provider from there. Unknown IDs get a 400.temperature,topP,topK,frequencyPenalty,presencePenaltyandmaxTokensby name instead of spreading the request config.npm testruns new Node test-runner tests through the existingtsxdev dependency.Behavior change
lib/models.ts. A Base URL saved in the browser is ignored.Screenshots
LLM settings menu on a local dev server.
Verification
npm test: 18 tests pass. Every provider calls its own host even when the request includes abaseURL, unknown models are rejected, and the routes forward only the sampling parameters.tscandnext buildare clean./api/chatreturns 400 for an unknown model and for an Ollama model whenOLLAMA_BASE_URLis unset.🤖 Generated with Claude Code