server: expose only the loaded model in /v1/models#419
Open
aledesogusbusiness-hue wants to merge 1 commit into
Open
server: expose only the loaded model in /v1/models#419aledesogusbusiness-hue wants to merge 1 commit into
aledesogusbusiness-hue wants to merge 1 commit into
Conversation
GET /v1/models was hardcoding both deepseek-v4-flash and deepseek-v4-pro regardless of which GGUF is actually loaded. GET /v1/models/<id> accepted either alias for the same reason. Use server_model_id_from_engine() at both sites so the list and the per-model lookup reflect the single model loaded at startup. Remove the now-unused server_model_alias_known() helper. Fixes: antirez#414 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
This is the same as #287? |
Yes, I think it is. #287 was the one I proposed when I opened the related issue #404. #419 is a smaller fix and looks OK for the endpoint behavior. #287 also includes the README update, a server unit test for Flash/Pro metadata, and an explicit id/name mapping so |
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.
Problem
GET /v1/modelsalways returns bothdeepseek-v4-flashanddeepseek-v4-proregardless of which GGUF is actually loaded at startup.GET /v1/models/<id>likewise accepts either alias.This misleads OpenAI-compatible clients that inspect
/v1/modelsto decide which models are available — they see two choices but the server always runs the single GGUF it was started with.Fix
send_models(): replace the hardcoded two-entry list with a single call toserver_model_id_from_engine(s->engine)./v1/models/<id>handler: compare the requested ID againstserver_model_id_from_engine(s->engine)directly; return 404 for the non-loaded model.server_model_alias_known()which is now unused.Test plan
GET /v1/modelsreturns onlydeepseek-v4-flash;GET /v1/models/deepseek-v4-proreturns 404.Fixes #414
🤖 Generated with Claude Code