Repository navigation
Conversation
Model cards built from llm.model registry entries dropped the entry's metadata table, so catalogs reading card.metadata could not take it from the registry. _build_model_card copies entry.data.metadata onto the card, defaulting to an empty table like pricing.
skhaz
approved these changes
Nov 14, 2026
The card copies entry.data.metadata as declared, like pricing. Replacing a non-table value with an empty table hides a misdeclared entry; the file validates no other payload field at build time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Model cards built from
llm.modelregistry entries have nometadatafield. A catalog that merges registry cards with cards from other sources (for example, a database) and readscard.metadatagets metadata only from the other sources. A registry entry cannot declare any.Cause
models._build_model_cardcopies a fixed list of fields into the card.metadatais not on that list.Fix
_build_model_cardcopiesentry.data.metadataonto the card. When the entry has none, it uses{}, the same defaultpricinggets (entry.data and entry.data.pricing or {}). A declared value is carried unchanged, including a non-table one, so a misdeclared entry stays visible to the consumer instead of reading as empty metadata._build_model_cardvalidates no payload field, andpricingfollows the same rule.The value comes from
entry.data, notentry.meta, because the card already splits its fields this way:name,title,class,capabilities,priority) come fromentry.meta.max_tokens,output_tokens,pricing,providers,dimensions,fallback) come fromentry.data.metadatais a free-form payload table likepricing. It is declared at the top level of the entry, next topricingin the README's "Registering Models" example. The registry stores those top-level keys inentry.data.Other changes:
ModelCardinllm.luagetsmetadata: table, typed the same way aspricing: table.llmitself does not read it.Tests
New cases in
src/llm/test/discovery/models_test.lua("card metadata"):data.metadataappears on the card returned byget_by_name,get_allandget_by_class.metadata = 42yields a card whosemetadatais42.Results:
wippy test ... test -- models_test: 25 passed. The non-table case fails against a build that replaces the value with{}(expected 42, got {}).wippy lint --level error: clean.