Instructions to use stonefish-labs/d3-mini-agentcode with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stonefish-labs/d3-mini-agentcode with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="stonefish-labs/d3-mini-agentcode", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("stonefish-labs/d3-mini-agentcode", trust_remote_code=True) model = AutoModel.from_pretrained("stonefish-labs/d3-mini-agentcode", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download REBUILD.md from stonefish-labs/d3-mini-agentcode: direct link, hf CLI and curl.
- Browser
- Download file 2.17 kB
-
https://huggingface.co/stonefish-labs/d3-mini-agentcode/resolve/main/REBUILD.md
- Command line
-
hf download hf://stonefish-labs/d3-mini-agentcode/REBUILD.md
-
curl -L -o REBUILD.md https://huggingface.co/stonefish-labs/d3-mini-agentcode/resolve/main/REBUILD.md
Rebuild and serve (d3-mini-agentcode, pre-release)
Use the merged weights (this repo)
The repo root is a complete d3 package: the base layout, runtime code, tokenizer and config, with the fine-tuned backbone weights and answer readout.
from transformers import AutoModel
model = AutoModel.from_pretrained("stonefish-labs/d3-mini-agentcode", trust_remote_code=True)
MODEL_MANIFEST.json lists every file's SHA-256 and size. On every load the runtime checks the files it reads
(verify="fast": it hashes files up to 64 MB and checks the size of larger ones). verify="full" hashes them all, and
verify="release" also checks the card and other files the runtime doesn't read. SHA256SUMS covers every file except
itself and the manifest.
Rebuild the merged weights from the adapter
adapter/ holds the LoRA adapter (adapter_model.safetensors, adapter_config.json), the trained answer readout
(readout.safetensors) and the training settings (training_args.json).
- Download the base package at the pinned revision:
huggingface-cli download vllm-sr/d3-mini --revision df99bf4ca4418bc6908ee68e9b7479af1f3b8800 --local-dir d3-mini - Merge (requires torch and safetensors; runs on CPU or GPU):
python adapter/merge.py --base d3-mini --adapter adapter --out merged --name d3-mini-agentcode- Each adapted weight becomes W ← bf16(W + (α/r)·B·A), with α/r = 2.
- The trained readout replaces the base readout.
- Everything else is copied from the base, and a new
MODEL_MANIFEST.jsonis written.
- Check: the rebuilt
model-0000{1,2}-of-00002.safetensorsandreadout.safetensorsmatch the hashes in this repo'sSHA256SUMS. They did on our rebuild.
Serve
- transformers: as above.
model.system_one(state=..., questions=...); seeexamples/usage.py. - vLLM Semantic Router: the package keeps d3-mini's format (
d3-code-readout-v1), so runtimes that serve d3-mini should serve it too (see the d3-mini card). We only ran it with the bundled runtime above. - Hardware: the bf16 weights take about 9 GB. On an RTX 4090, batches of 8 at up to 8,192 tokens peaked at 12.7 GiB allocated.