Skip to content

report the model kind as olla.type in the models api - #249

Merged
thushan merged 6 commits into
mainfrom
feature/model-type-field
Oct 27, 2026
Merged

thushan merged 6 commits into
mainfrom
feature/model-type-field

Conversation

@thushan

@thushan thushan commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

There was no reliable way to ask what kind of model something is. ?type= matched a mix of provider names and capabilities, so an embedder named ...instruct listed under both embeddings and llm.

/olla/models now reports each model's kind (llm, vlm, embeddings, reranker, classifier) as olla.type, and /olla/models/{id} as a top-level type, via ModelKind() in converter/base_converter.go. ?type= matches that kind exactly. A model reporting vlm or carrying vision is vlm only. ?capability=chat is unchanged and still returns every model that can chat, vision models included.

The vLLM, SGLang, Lemonade, LMDeploy, llama.cpp, vLLM-MLX and Docker Model Runner parsers no longer write their provider name into type, so /internal/status/models omits it unless the backend reported a kind. In the LM Studio-format listing, rerankers and classifiers recognised by name now get their own type instead of falling back to llm; that value can be reranker or classifier, outside LM Studio's own vocabulary.

Type of change

  • New feature
  • Behaviour change
  • Documentation

How was this tested?

New and updated tests:

  • TestModelKind, TestModelInfoKind, TestUnifiedModels_ModelKind
  • TestDefaultUnifier_ProviderNameIsNotModelType
  • ?type= and ?capability=chat cases in handler_unified_models_test.go and handler_status_models_test.go
  • parser tests for each affected backend updated for the dropped type

Tested together with the other October follow-up branches on a local integration branch at 0c25e0a:

  • make ready and make test-race pass at 0c25e0a
  • /olla-validate --quick: 42 pass, 0 fail (warnings and skips are nightly-only items)
  • tei-routing validation area: Section A 12/12, Section B B1 to B6 pass
  • /test-sticky-sessions: no new failures (the 7 provider-route 404s are the known shared-mock-URL limitation)
  • /claude-code-e2e against real Ollama: Tier A 16/0 on both the passthrough and translation legs, same as main
  • curl checks per feature against real Ollama and ollamock; log scan shows no panics, races or per-request WARN floods

Checklist

  • make ready passes at 5a9c361
  • Tests added or updated for the change
  • Documentation updated: v0.0.30 release note
  • No new dependencies added

Summary by CodeRabbit

  • New Features
    • Model listings and details now report a model’s kind, such as llm, vlm, embeddings or reranker, when it can be determined.
    • Filter models by exact kind with type; capability filters remain available for matching what models can do.
    • Vision-capable models appear in chat-capability results, and embedding models are listed separately from language models.
  • Bug Fixes
    • Provider names are no longer reported as model kinds when a backend does not provide that information.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The models API now reports model kinds and filters by exact kind. Capability filtering remains separate, and provider names are no longer assigned as model kinds by the updated parsers.

Changes

Model kind API

Layer / File(s) Summary
Determine model kinds
internal/adapter/converter/base_converter.go, internal/adapter/converter/base_converter_test.go, internal/adapter/registry/profile/*_parser.go, internal/adapter/registry/profile/*_parser_test.go, internal/adapter/registry/profile/parsers.go, internal/adapter/discovery/integration_test.go, internal/adapter/unifier/metadata_integration_test.go
Kind determination now recognises rerankers and classifiers, and infers llm for text-generation, chat, or completion capabilities when no kind is reported. The updated provider parsers leave model kind empty when they do not receive one from the backend.
Separate kind and capability filtering
internal/core/ports/model_converter.go, internal/adapter/converter/unified_converter.go
Type filters now match the determined kind exactly. Capability filters match capabilities separately, with chat matching chat, completion, or text-generation models. Empty kinds are omitted from converted JSON.
Expose model kinds in API responses
internal/app/handlers/handler_unified_models.go, internal/app/handlers/handler_unified_models_test.go, internal/app/handlers/handler_status_models.go, internal/app/handlers/handler_status_models_test.go, docs/content/api-reference/models.md, docs/content/about/release-notes.md
Unified model responses include a kind when it can be determined. Status summaries use backend-reported kind metadata. Tests and documentation cover kind reporting, exact type filtering, capability filtering, and omitted kinds.

Priority: Not assessed

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant unifiedModelsHandler
  participant modelConverter
  Client->>unifiedModelsHandler: Request models with type or capability filter
  unifiedModelsHandler->>modelConverter: Convert models and apply filters
  modelConverter-->>unifiedModelsHandler: Return matching models with kinds
  unifiedModelsHandler-->>Client: Return model listing
Loading

Possibly related PRs

  • thushan/olla#231: Adds TEI model discovery and assigns the embeddings, reranker, and classifier kinds that this PR exposes and filters through the models API.
Merge Risk: Low · up to 0df5d

Some models may be reported under the wrong kind, and combined filters may return models outside the requested type. The affected cases are narrow; merge with owner awareness or fix them first.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thushan
thushan merged commit 3b66e7e into main Oct 27, 2026
7 of 8 checks passed
@thushan
thushan deleted the feature/model-type-field branch October 27, 2026 21:32
@coderabbitai coderabbitai Bot mentioned this pull request Oct 27, 2026
13 tasks done
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