Merged
Size
M
Change Breakdown
Feature50%
Performance40%
Testing10%
#64753Ollama: cache model show metadata

Ollama model metadata now cached by digest

Ollama model metadata now cached by digest

Model picker refreshes stop hammering the Ollama API for unchanged models — context-window and capability metadata is cached and only refetched when the model digest changes.

When users browse available Ollama models in the picker, each refresh previously triggered fresh API calls to fetch context-window and capability metadata for every model. On large model lists, this meant waiting on dozens of redundant requests.

A new caching layer now stores metadata from Ollama's /api/show endpoint, keyed by model name and digest. Repeated picker refreshes skip straight to the cache for unchanged models. The cache holds up to 256 entries and automatically invalidates when a model's digest changes — the model was updated, so its metadata might be different too. Empty responses trigger retries before caching, ensuring partial or transient failures don't poison the cache.

This change lives in the Ollama extension's model enrichment pipeline. It does not alter model semantics — the same metadata is returned, just fetched fewer times.

View Original GitHub Description

Summary

  • cache Ollama /api/show enrichment results for discovery/model-picker flows when a model digest or modified timestamp is stable
  • reuse cached context-window and capability metadata across repeated enrich calls without changing model semantics
  • add targeted tests covering cache reuse and cache invalidation on digest changes

Testing

  • pnpm test extensions/ollama/src/provider-models.test.ts extensions/ollama/src/provider-models.ssrf.test.ts
© 2026 · via Gitpulse