Expand description
Parsing a user-typed model reference — a bare id, a hf.co/... or
ollama.com/... link — into a Hugging Face repo (org/name) or an Ollama tag
(name:version). Pure string work; the ambiguity is resolved consistently so
the CLI and gateway accept identical inputs.
Functions§
- hugging_
face_ repo - The
org/namerepo a Hugging Face reference points at, orNoneifrawis not a plausible HF repo. A multi-segment path is only accepted from an explicithf.co/huggingface.colink whose third segment is empty or a known HF subpath. - is_
hugging_ face_ link - Whether
rawis a Hugging Face URL. - is_
ollama_ link - Whether
rawis an Ollama URL. - is_
ollama_ tag_ shaped - Whether
referenceis a well-formed Ollama tag (an explicit version is required for a namespaced reference). Part of the parsing API the gateway/cli use to validate a typed tag, alongside the otherreferenceentry points. - normalized
- A reference normalized for
provider: Ollama tags gain:latestand lowercase; other providers lowercase. - normalized_
tag - A tag with
:latestadded when no version is present, lowercased. - ollama_
direct_ tag - The Ollama tag for a search query — only when it isn’t an HF repo and the input
carries an explicit
:or is an Ollama link (so a bare word doesn’t resolve to Ollama by default). - ollama_
install_ tag - The Ollama tag for an install, allowing a namespaced reference without an
explicit version (it defaults to
:latestdownstream). - ollama_
tag - The Ollama tag a reference points at, requiring an explicit
:versionfor a namespaced (org/name) reference.