[Bug]: OpenRouter model discovery never lists embedding models (separate /embeddings/models endpoint not queried)

Author: QuaditzCreated Aug 17, 2026Updated Sep 5, 2026
Labelsbugreadyarea: providers

Problem

In the Discover Models dialog for an OpenRouter credential, switching Model Type to Embedding still shows only chat models, so no embedding model can be registered from the UI. Reported in the original issue against v1.14.0 (original report preserved below).

Root cause

  • OpenRouter serves chat models at /api/v1/models (431 today, no embeddings) and embedding models at a separate /api/v1/embeddings/models (33 today). Our discovery only queries the first. Esperanto's OpenRouter embedding provider already uses the second.
  • The Model Type dropdown in DiscoverModelsDialog is not a filter; it is the type stamped on the selected models at registration. That is fine for providers whose single /models catalogue mixes types (OpenAI), but for OpenRouter there is nothing to stamp as embedding.
  • POST /credentials/{id}/discover drops model_type from the response for every provider (api/routers/credentials.py builds DiscoveredModelResponse without it), so the dialog could not filter even if the backend classified.

Workaround today: type the embedding model id in the search box and use "Add " with type Embedding.

Fix

Backend (api/credentials_service.py, discover_with_config openrouter branch):

  • Fetch /api/v1/models and tag as language, and /api/v1/embeddings/models and tag as embedding.
  • Attach OPENROUTER_AUDIO_MODELS with the type from their seed entry instead of untyped.

Backend (api/routers/credentials.py):

  • Pass model_type through in DiscoveredModelResponse (this also unbreaks Ollama, which already classifies).

Frontend (frontend/src/components/settings/DiscoverModelsDialog.tsx):

  • When an item has model_type, show it only under that type; items without a type stay visible under every type.
  • Base showCustomOption on the filtered list, and prune selectedModels when the type changes.

Tests:

  • tests/test_credentials_api.py: discover_with_config("openrouter") with both endpoints mocked returns typed entries.
  • New DiscoverModelsDialog.test.tsx: switching to Embedding hides chat models and keeps the custom option.

Acceptance criteria

  • With an OpenRouter credential, selecting Embedding in Discover Models lists the models from /embeddings/models and registering one works.
  • Language, TTS and STT lists are unchanged for OpenRouter.
  • Ollama discovery now returns model_type in the API response.
  • Other providers' discovery behaviour is unchanged (items without type still appear under every type).

Related

PR #1305 attempted this on the legacy GET /models/discover/{provider} path, which the UI does not call.


Original report

What did you do when it broke?

  1. Create Open Notebook Server via docker compose
  2. Go to Models -> Add Openrouter API Config
  3. Test -> OK
  4. Models -> Default Selection: Language Model Type -> 417 models available -> GOOD
  5. Clicking Model Type Dropdown -> Selecting anything other than Language -> Model list still only shows Lanague models -> No embedding model possible to select -> Cant use Open Notebook

See screenshot: Type switched to Embedding, options below are still language models

Image

Hint: registering the models directly via POST /api/credentials/{credential_id}/register-models worked and they became visible in the UI. Just the dropdown didn't work.

Environment

Open Notebook 1.14.0 (v1-latest Docker), Fedora Server