The README is the API
Every model repo's README.md opens with a YAML front-matter block fenced by --- delimiters. That block is not styling. It's machine-readable metadata that drives: which inference widget renders on the page, which providers list the model, how the search index ranks it, what license shows on the buy/use widget, and what the library_name auto-loader does.
Fields you can't skip
library_name— required since Aug 2024. Tells the Hub which loader to use.transformers,diffusers,sentence-transformers,mlx,peft,llama.cpp, etc.pipeline_tag— the task. Drives the inference widget. Examples:text-generation,image-text-to-text,automatic-speech-recognition,feature-extraction.license— SPDX identifier or one of HF's specials (apache-2.0,mit,llama3,llama3.1,gemma). Thellama*licenses gate downloads behind a click-through.language— list of ISO 639-1 codes. Controls language facet in search.base_model,base_model_relation— lineage. Relation is one offinetune | adapter | merge | quantized. The Hub renders a tree from this.tags— free-form facets.conversational,code,moe,4bit, etc.gated—true | auto | manual. Gates download behind license acceptance or manual approval.
Reading cards programmatically
Don't curl the README. Use model_info(); it returns a parsed object whose .cardData attribute is the YAML decoded as a dict. The same applies to dataset_info() and space_info().