Skip to content

docs(openspec): propose creating an Outfit from a Hugging Face ref - #74

Draft
outofcoffee wants to merge 1 commit into
mainfrom
openspec/hf-outfit-command
Draft

docs(openspec): propose creating an Outfit from a Hugging Face ref#74
outofcoffee wants to merge 1 commit into
mainfrom
openspec/hf-outfit-command

Conversation

@outofcoffee

Copy link
Copy Markdown
Collaborator

An OpenSpec change proposing outfit hf <ref>, a command that turns a Hugging Face model reference into a working Outfit.

Summary

  • New command outfit hf <ref>: reads a Hugging Face model repo and writes the Outfit for it, so a pasted model reference becomes a working config without hunting through the model page for the quantisation, the engine and the context window.
  • Everything is inferred and every inference is overridable: PROVIDER from the repo's files (GGUF → llamacpp, MLX → omlx, safetensors → vllm), the quantisation from the GGUF filenames, CONTEXT from the published config.json, and ALIAS from the repo name. The reasoning goes to stderr so stdout stays a clean Outfit.
  • The existing caches are read, never bypassed: a model already in the Hugging Face cache — or in llama.cpp's own cache — is named by its path on disk, so the engine loads what is there instead of downloading a second copy. A fully cached model resolves with no network request at all.
  • outfit never downloads weights. Describing a model is metadata only; fetching stays the engine's job, as it is today.
  • Optional Hugging Face token resolved from HF_TOKEN, HUGGING_FACE_HUB_TOKEN or the CLI's token file, so gated and private repos work for a logged-in user. It is never written or printed.
  • --output-file/-o writes the file (refusing to clobber without --force), --apply dresses the harness in the same step, and --no-cache forces the portable repo-reference form.
  • Two new capabilities: huggingface-hub (reference forms, Hub reads, token, cache lookup) and huggingface-outfits (the command and its inference rules).

Implementation details

Two decisions are worth a reviewer's attention.

No Go SDK. The closest thing is gomlx/go-huggingface, which does share the Python cache layout, but its module requires gomlx, parquet-go, protobuf, sentencepiece and lipgloss — a machine-learning framework's dependency graph for a CLI with three direct dependencies. The other candidates are downloader-shaped, and the download path is exactly what this change does not want. internal/hf is stdlib-only: two JSON endpoints and a documented directory layout. The package boundary is where a library could slot in later if the write path is ever wanted.

The two caches are separate. llama-server -hf writes into LLAMA_CACHE, not the Hugging Face cache, so a model downloaded by outfit serve is invisible to the HF layout and vice versa — both are checked. llama.cpp's filename convention is not a documented contract, so that lookup requires the owner, the repo name and the quant to all match; a false negative just falls back to the repo reference, which is what would have been written anyway.

One consequence worth naming: a cached-path MODEL describes one machine's disk, and Outfits do get committed. The narration says so at the moment it happens, and --no-cache produces the shareable form.

Add the add-hf-outfit-command change: an `outfit hf <ref>` command that
reads a Hugging Face model repo and writes the Outfit for it, inferring
the provider from the repo's files, the quantisation from its GGUF
names, and the context window from its published config.

The local Hugging Face and llama.cpp caches are read so an
already-downloaded model is named by its path rather than downloaded a
second time; outfit itself never transfers weights. An optional token is
resolved from the usual places for gated and private repos.

Covers two new capabilities, huggingface-hub and huggingface-outfits,
with the design and task breakdown behind them.
@outofcoffee outofcoffee added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant