Thanks to visit codestin.com
Credit goes to github.com

Skip to content

server: add model name validation and alias resolution to EmbedHandler#14565

Open
umut-polat wants to merge 1 commit intoollama:mainfrom
umut-polat:fix/embed-handler-model-validation
Open

server: add model name validation and alias resolution to EmbedHandler#14565
umut-polat wants to merge 1 commit intoollama:mainfrom
umut-polat:fix/embed-handler-model-validation

Conversation

@umut-polat
Copy link

EmbedHandler was missing two steps that both GenerateHandler and ChatHandler perform:

  1. Model name validation (name.IsValid() check) — an empty or invalid model name went straight to getExistingName, producing a confusing "model not found" error instead of the expected "model is required".

  2. Alias resolution (resolveAlias) — model aliases were silently ignored for /api/embed requests while working correctly for /api/generate and /api/chat.

This aligns EmbedHandler's validation flow with the other handlers.

EmbedHandler was missing the model name validation (IsValid check)
and alias resolution that GenerateHandler and ChatHandler both
perform. This meant an empty model name produced a confusing
"model not found" error instead of "model is required", and model
aliases were not resolved for embed requests.

Signed-off-by: umut-polat <[email protected]>
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.

1 participant