[PR #14565] [CLOSED] server: add model name validation and alias resolution to EmbedHandler #40598

Closed
opened 2026-04-23 01:27:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14565
Author: @umut-polat
Created: 3/2/2026
Status: Closed

Base: mainHead: fix/embed-handler-model-validation


📝 Commits (1)

  • c714c9b server: add model name validation and alias resolution to EmbedHandler

📊 Changes

1 file changed (+14 additions, -1 deletions)

View changed files

📝 server/routes.go (+14 -1)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/14565 **Author:** [@umut-polat](https://github.com/umut-polat) **Created:** 3/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/embed-handler-model-validation` --- ### 📝 Commits (1) - [`c714c9b`](https://github.com/ollama/ollama/commit/c714c9b34eefa4c05532e11fc28cffee57bbf00e) server: add model name validation and alias resolution to EmbedHandler ### 📊 Changes **1 file changed** (+14 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/routes.go` (+14 -1) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 01:27:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#40598