Skip to content

fix(db): include local no-API-key providers in Qdrant embedding-model list - #11995

Merged
diegosouzapw merged 1 commit into
release/v3.8.51from
fix/11949-qdrant-local-embedding-providers
Aug 29, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.51from
fix/11949-qdrant-local-embedding-providers

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

What changed

The Qdrant embedding-model dropdown (GET /api/settings/qdrant/embedding-models) only
treated a provider connection as "configured" when it had a non-empty apiKey or
authType === "oauth". Local/self-hosted providers — ollama-local, lm-studio,
vllm, etc. (src/shared/constants/providers/local.ts) — connect through
src/app/api/providers/route.ts with authType: "apikey" and no apiKey (the
connect form never asks for one), so an active, tested-and-"Ativo" local connection's
embedding models (embeddinggemma, nomic-embed-text, bge-m3 for ollama-local,
registered in open-sse/config/embeddingRegistry.ts) never appeared in the dropdown.
Reported from the WhatsApp support channel.

Root cause

configuredProviders in src/app/api/settings/qdrant/embedding-models/route.ts was
built from activeConnections.filter(...) requiring either a real key or OAuth, with
no branch for providers that don't require a key at all.

Fix

Extended that filter to also include a connection when
providerAllowsOptionalApiKey(connection.provider) is true — the existing canonical
helper in src/shared/constants/providers.ts, already used for the identical
requiresApiKey check in src/app/api/providers/[id]/test/route.ts:930 and across
every src/shared/validation/schemas/*.ts Zod schema. No new hardcoded provider-id
list was introduced; a remote provider that genuinely requires a key (e.g. openai
with no key on its connection) is still excluded, unchanged.

TDD evidence (Hard Rule #18)

Added two tests to tests/integration/qdrant-routes.test.ts:

  • GET /api/settings/qdrant/embedding-models — includes an active local no-API-key provider (#11949)
    — fails before the fix (AssertionError: should list ollama-local embedding models for an active, key-less local connection, confirmed by running it against the
    pre-fix route.ts), passes after.
  • GET /api/settings/qdrant/embedding-models — still excludes a remote provider with no key
    — regression guard proving the fix does not just drop the filter for remote providers.

Full file: node --import tsx/esm --test tests/integration/qdrant-routes.test.ts →
21/21 passing after the fix (was 20/21, the new test failing, before it).

Gates run (green)

  • npm run typecheck:core — clean
  • npm run typecheck:noimplicit:core — clean
  • npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files> — 0 errors (2 new no-explicit-any sites introduced by the new tests were typed against a local EmbeddingModelOptionLike interface instead of widening the frozen suppression count)
  • npm run check:complexity-ratchets — OK (2672/2774 cyclomatic, 1192/1223 cognitive — both under baseline)
  • node scripts/check/check-file-size.mjs — OK
  • node scripts/check/check-test-discovery.mjs — OK

Scope: only the route, the canonical-helper import, the new/typed tests, and the
changelog fragment — no other files touched.

⚠️ base-red inherited: #11874 — Docs sync + fabricated-docs (strict)

Closes #11949

… list (#11949)

The embedding-models route only treated a provider connection as "configured"
when it had a real apiKey or authType "oauth". Local/self-hosted providers
(ollama-local, lm-studio, vllm, etc.) connect through the connections route
with authType "apikey" but no apiKey — the connect form never asks for one
(src/shared/constants/providers/local.ts) — so an active local connection's
embedding models (embeddinggemma, nomic-embed-text, bge-m3 for ollama-local)
never surfaced in the dropdown even though the connection tested "Ativo".

Reuse the existing canonical providerAllowsOptionalApiKey() helper
(src/shared/constants/providers.ts) — already used for the identical
requiresApiKey check in src/app/api/providers/[id]/test/route.ts and across
the Zod validation schemas — instead of hardcoding a provider id list.
@diegosouzapw
diegosouzapw merged commit c9b1c12 into release/v3.8.51 Aug 29, 2026
20 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
… list (cheaper-inference#11949) (cheaper-inference#11995)

Local no-API-key providers (ollama-local, lm-studio, vllm, etc.) were invisible in the Qdrant embedding-model dropdown because configuredProviders required a real apiKey or OAuth. Extended the filter to also include providerAllowsOptionalApiKey(connection.provider) — the same canonical helper already used for the identical check elsewhere. TDD: 21/21 integration tests pass (was 20/21 before the fix).
@diegosouzapw
diegosouzapw deleted the fix/11949-qdrant-local-embedding-providers branch October 18, 2026 23:48
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.

[bug] Qdrant embedding-model list excludes local (no-API-key) providers like Ollama

2 participants