ollama - ✅(Solved) Fix Add capabilities field to /api/tags response [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#14964Fetched 2026-04-08 01:03:48
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
commented ×1cross-referenced ×1labeled ×1

Fix Action

Fixed

PR fix notes

PR #14966: api: add capabilities field to /api/tags response

Description (problem / solution / changelog)

  • Adds capabilities field to each model in the /api/tags response, matching what /api/show already returns

    • Clients no longer need N+1 /api/show calls to filter models by capability (e.g. chat vs embedding)

    • Adds test coverage for capabilities in list responses

    • Existing TestList passes and now also asserts capabilities

    • New TestListCapabilities verifies completion vs embedding models return correct capabilities

    • Middleware TestListMiddleware passes (backwards compatible via omitempty)

    Fixes #14964

Changed files

  • api/types.go (modified, +9/-8)
  • docs/api.md (modified, +4/-2)
  • docs/openapi.yaml (modified, +10/-0)
  • server/routes.go (modified, +26/-2)
  • server/routes_list_test.go (modified, +61/-0)
RAW_BUFFERClick to expand / collapse

Problem

The /api/tags endpoint lists all local models but does not include any capability information (chat, embedding, vision, etc.). Clients building model selectors for chat need to know which models support chat/completion vs embedding-only.

Currently, the only way to get this information is by calling /api/show for each model individually, which results in
N+1 API calls just to filter a model list.

This was originally requested in #3117. The capabilities field was added to /api/show, which is great, but it was not
added to /api/tags.

Proposed Solution

Include the capabilities array in each model object returned by /api/tags:

{
"models": [
{
"name": "llama3:latest", "modified_at": "...",
"size": 123456,
"digest": "...",
"details": { ... },
"capabilities": ["completion", "tools"]
},
{
"name": "nomic-embed-text:latest",
"modified_at": "...",
"size": 123456,
"digest": "...",
"details": { ... },
"capabilities": ["embedding"]
}
]
}

Use Case

Desktop applications and web UIs that integrate with Ollama need to show only chat-capable models in their chat model
selector. Without this field on /api/tags, clients must make an extra /api/show call per model to determine capabilities, which is inefficient and unnecessary since the data already exists.

extent analysis

Fix Plan

To include the capabilities array in each model object returned by /api/tags, we need to modify the API endpoint to fetch and include this information.

Steps:

  • Update the /api/tags endpoint to fetch model capabilities
  • Modify the response object to include the capabilities field

Example Code:

# Assuming a Python backend using Flask
from flask import jsonify
from your_database import get_models, get_model_capabilities

@app.route('/api/tags', methods=['GET'])
def get_tags():
    models = get_models()
    response = []
    for model in models:
        model_info = {
            "name": model.name,
            "modified_at": model.modified_at,
            "size": model.size,
            "digest": model.digest,
            "details": model.details,
            "capabilities": get_model_capabilities(model.name)  # Fetch capabilities for each model
        }
        response.append(model_info)
    return jsonify({"models": response})

Verification

To verify the fix, make a GET request to the /api/tags endpoint and check that the response includes the capabilities field for each model.

Extra Tips

  • Ensure that the get_model_capabilities function is efficient and does not introduce significant performance overhead.
  • Consider caching the capabilities information to reduce the number of database queries.
  • Update any relevant documentation and client-side code to utilize the new capabilities field.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - ✅(Solved) Fix Add capabilities field to /api/tags response [1 pull requests, 1 comments, 2 participants]