xdLocutus's picture
Upload folder using huggingface_hub
37872b1 verified
|
Raw History Blame Contribute Delete
4.91 kB
---
title: Smaug-Flash Explorer
emoji: πŸ‰
colorFrom: indigo
colorTo: pink
sdk: static
pinned: false
license: mit
short_description: Specs, benchmarks, real encoder, BYO-endpoint chat
---
# πŸ‰ Smaug-Flash Explorer
An interactive companion page for
[`abacusai/Smaug-Flash`](https://huggingface.co/abacusai/Smaug-Flash) β€” Abacus.AI's agentic-coding
fine-tune of [`deepseek-ai/DeepSeek-V4-Flash-0731`](https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731)
(304.18 B params, 166.9 GB checkpoint across 48 shards, 1 M context, MIT).
Everything runs **client-side in your browser**: no backend, no GPU, no quota.
| Tab | What it actually does |
|---|---|
| 🧭 **Overview** | Spec table from `config.json` and the Hub's safetensors metadata, checkpoint anatomy, training approach (2Γ— SFT + 1Γ— KTO LoRA merged as full attention-only deltas), known behaviors and inference gotchas β€” plus live Hub stats fetched from the public API. |
| πŸ“Š **Benchmarks** | The model card's numbers as Plotly charts: grouped Smaug-Flash vs base bars, a delta chart, and a LiveBench category radar β€” with the card's own figures embedded for comparison and its caveats spelled out. |
| πŸ”€ **Prompt encoder** | The repo ships **no Jinja chat template**, so this tab runs the model's own `encoding/encoding_dsv4.py` β€” vendored here **byte-for-byte unmodified** and executed by Pyodide β€” to turn any message list into the exact prompt string the model was trained on. It also parses a raw completion back into OpenAI-format fields. |
| πŸ’¬ **Playground** | A streaming chat client that speaks OpenAI-compatible SSE directly from your browser to an endpoint you choose: your own vLLM/SGLang deployment, a tunnelled remote one, or the HF router (for a plumbing check against a live Flash-class model). |
| πŸš€ **Deploy & size** | The card's vLLM and SGLang recipes, the reference `inference/` conversion path, a Python client snippet, and an interactive weight-memory calculator that maps quantization choices onto real GPU tiers and prices. |
## Why there is no in-Space inference
The checkpoint is **304.18 B parameters / 166.9 GB on disk** (packed-FP4 experts + block-FP8
attention) and its Hub `inferenceProviderMapping` is **empty** β€” no serverless Inference Provider
serves it. HF Spaces hardware tops out at ZeroGPU's 96 GB, and the native-format budget is ~165 GB of
weights before any KV cache, so the weights cannot be loaded in a Space. This page therefore does the
things that *do* work at zero GPU cost.
To serve the model for real, see the **Deploy & size** tab β€” a dedicated multi-GPU tier for this
model starts around $5.50/h. If you want a Space to serve it, a
[community GPU grant](https://huggingface.co/docs/hub/spaces-gpus) is the route.
## Notes worth knowing
* **Special-token delimiter.** The repo's `encoding_dsv4.py` *and* its `tokenizer.json` delimit
special tokens with `U+FF5C` (`οΌΌ`) rather than ASCII `|` β€” near-identical in most fonts, which is
why a hand-typed pipe silently fails to parse. The decoder repairs typed ASCII pipes and tells you
when it did.
* `reasoning_effort` ∈ `low` (0-char preamble) / `high` (476 chars) / `max` (526 chars); `None` is
treated as `low`, it only applies in `thinking` mode, and only on the first message. Budget up to
384 K output tokens for high/max.
* The encoder is strict by design: malformed completions raise (`missing thinking`, `missing EOS
token`, `Unexpected content at end`) instead of being patched up β€” the card is explicit about that.
* Benchmark values in the charts are **digitized from the model card's figures**; the originals are
embedded on the page and remain authoritative.
## Running it locally
```bash
git clone https://huggingface.co/spaces/xdLocutus/Smaug-Flash-Explorer
cd Smaug-Flash-Explorer
python -m http.server 8765 # open http://127.0.0.1:8765
```
Locally is also the easiest way to use the Playground against a local runtime
(`http://127.0.0.1:8000/v1`): no TLS, no CORS friction.
## Optional: the Gradio variant
`app.py` + `requirements.txt` in this repo are a **Gradio port of the same five tabs** (same data,
same vendored encoder, plus an API/MCP surface). They are inert while the README frontmatter says
`sdk: static`. To switch, replace the frontmatter with:
```yaml
sdk: gradio
sdk_version: 6.31.0
app_file: app.py
python_version: "3.12"
```
That requires hardware β€” Gradio Spaces on a free account need PRO, and ZeroGPU additionally needs a
30-day-old account or an approved community grant. The Gradio app is designed for ZeroGPU: it keeps a
no-op `@spaces.GPU` function so the runtime is attached but no quota is spent, since it never touches
CUDA.
## Attribution
Model card and repository contents (MIT) belong to Abacus.AI; `encoding_dsv4.py` is vendored
unmodified from the model repo; the base architecture is DeepSeek-AI's. This Space is unofficial.