Populate resolved_model in the default OpenAI plugin from the response `model` field

Open Beginner friendly
#1,681 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start in llm/default_plugins/openai_models.py by reading the default OpenAI Chat and AsyncChat response handling and the existing set_resolved_model() method. Use the response's model field only when it is present and differs from the requested model id, then verify that resolved_model records the returned model without adding another API call.

Written by the indexing model from the issue text.

Description

Following #1117: set_resolved_model() shipped in 0.27, and plugins like llm-gemini (modelVersion) and llm-llama-server (/models) now record the resolved model. The built-in OpenAI plugin (llm/default_plugins/openai_models.py) doesn't call it, even though the OpenAI-compatible response already carries a model field that resolves aliases to the dated snapshot — exactly the "you asked for a *-latest alias, the API tells you which version actually answered" case from #1117.

Proposal: in the default OpenAI Chat/AsyncChat plugin, call response.set_resolved_model(...) from the response's own model field when it is present and differs from the requested model id. Zero extra calls (the field is already in every response body), and it makes resolved_model populated by default for the most common provider — surfacing silent alias→version resolution, and any gateway/relay substitution, directly in llm logs.

Context for the rationale (reading the served model on every turn as a zero-cost provenance signal): Engine Provenance, doi.org/10.5281/zenodo.22722524 — but the concrete ask here is just wiring the existing set_resolved_model method into the default OpenAI plugin.

Dominant language
Python
Stars
12.5k
Forks
998
Avg merge
8d 1h
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from simonw/llm

All issues in simonw/llm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.