Automatic Speech Recognition
GGUF
ggml
quantized
llama.cpp
qwen3-asr
speech-recognition
on-device
conversational
Instructions to use javierbits/Rumble-2-Flash-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use javierbits/Rumble-2-Flash-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf javierbits/Rumble-2-Flash-GGUF:Q5_K_M # Run inference directly in the terminal: llama cli -hf javierbits/Rumble-2-Flash-GGUF:Q5_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf javierbits/Rumble-2-Flash-GGUF:Q5_K_M # Run inference directly in the terminal: llama cli -hf javierbits/Rumble-2-Flash-GGUF:Q5_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf javierbits/Rumble-2-Flash-GGUF:Q5_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf javierbits/Rumble-2-Flash-GGUF:Q5_K_M
Use Docker
docker model run hf.co/javierbits/Rumble-2-Flash-GGUF:Q5_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use javierbits/Rumble-2-Flash-GGUF with Ollama:
ollama run hf.co/javierbits/Rumble-2-Flash-GGUF:Q5_K_M
- Unsloth Desktop
- Docker Model Runner
How to use javierbits/Rumble-2-Flash-GGUF with Docker Model Runner:
docker model run hf.co/javierbits/Rumble-2-Flash-GGUF:Q5_K_M
- Lemonade
How to use javierbits/Rumble-2-Flash-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull javierbits/Rumble-2-Flash-GGUF:Q5_K_M
Run and chat with the model
lemonade run user.Rumble-2-Flash-GGUF-Q5_K_M
List all available models
lemonade list
- Atomic Chat
Download bench_release.py from javierbits/Rumble-2-Flash-GGUF: direct link, hf CLI and curl.
- Browser
- Download file 16.7 kB
-
https://huggingface.co/javierbits/Rumble-2-Flash-GGUF/resolve/main/bench_release.py
- Command line
-
hf download hf://javierbits/Rumble-2-Flash-GGUF/bench_release.py
-
curl -L -o bench_release.py https://huggingface.co/javierbits/Rumble-2-Flash-GGUF/resolve/main/bench_release.py
16.7 kB
| #!/usr/bin/env python3 | |
| """Accuracy benchmark: transformers BF16 reference vs the llama.cpp GGUF build. | |
| Runs the same utterances through both engines (greedy, forced language), scores them with | |
| Whisper's normalizers (CER for Chinese), and writes paired bootstrap confidence intervals. | |
| Designed as a release gate for the quantized model. | |
| .venv/bin/python bench_release.py --clips 100 \ | |
| --clips-file data/bench_clips.json --out-dir out/bench | |
| Outputs: out/bench/{bf16,gguf}.json (per-clip transcripts) and out/bench/REPORT.md. | |
| """ | |
| import argparse, hashlib, json, os, random, shutil, statistics, subprocess, time | |
| from datetime import date | |
| from pathlib import Path | |
| import requests | |
| import soundfile as sf | |
| import torch | |
| from transformers import AutoModelForMultimodalLM, AutoProcessor | |
| from transformers.models.whisper.tokenization_whisper import ( | |
| BasicTextNormalizer, EnglishTextNormalizer, | |
| ) | |
| HERE = Path(__file__).resolve().parent | |
| MODEL_ID = "Reson8/Rumble-2-Flash" | |
| # Works both in the demo checkout (GGUF files under models/) and in a downloaded GGUF repo | |
| # (files next to this script). | |
| MODEL_DIR = HERE / "models" if (HERE / "models").is_dir() else HERE | |
| GGUF_DECODER = MODEL_DIR / "Rumble-2-Flash-Q5_K_M.gguf" | |
| GGUF_MMPROJ = MODEL_DIR / "mmproj-Rumble-2-Flash-Q8_0.gguf" | |
| LLAMA_SERVER = os.environ.get("LLAMA_SERVER") or next((p for p in ( | |
| str(HERE / "llama.cpp/build-cuda/bin/llama-server"), | |
| str(HERE / "llama.cpp/build/bin/llama-server"), | |
| str(HERE / "../llama.cpp/build-cuda/bin/llama-server"), | |
| str(HERE / "../llama.cpp/build/bin/llama-server"), | |
| ) if Path(p).is_file()), shutil.which("llama-server")) | |
| LANG_NAMES = {"en_us": "English", "es_419": "Spanish", "pt_br": "Portuguese", | |
| "de_de": "German", "fr_fr": "French", "cmn_hans_cn": "Chinese", | |
| "yue_hant_hk": "Cantonese"} | |
| ISO = {"en_us": "en", "es_419": "es", "pt_br": "pt", "de_de": "de", "fr_fr": "fr", | |
| "cmn_hans_cn": "zh", "yue_hant_hk": "yue"} | |
| CJK = ("cmn_hans_cn", "yue_hant_hk") | |
| EN_NORM = EnglishTextNormalizer({}) # spelling map omitted: affects British/American spellings only | |
| BASIC_NORM = BasicTextNormalizer() | |
| def normalize(text: str, lang: str) -> str: | |
| return (EN_NORM if lang == "en_us" else BASIC_NORM)(text).strip() | |
| def edit_distance(a: list, b: list) -> int: | |
| prev = list(range(len(b) + 1)) | |
| for i, x in enumerate(a, 1): | |
| cur = [i] | |
| for j, y in enumerate(b, 1): | |
| cur.append(min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + (x != y))) | |
| prev = cur | |
| return prev[-1] | |
| def score(ref: str, hyp: str, lang: str) -> float: | |
| r = normalize(ref, lang) | |
| h = normalize(hyp, lang) | |
| if lang in CJK: | |
| r, h = r.replace(" ", ""), h.replace(" ", "") | |
| return edit_distance(list(r), list(h)) / max(1, len(r)) | |
| r, h = r.split(), h.split() | |
| return edit_distance(r, h) / max(1, len(r)) | |
| def sha256(path: Path) -> str: | |
| h = hashlib.sha256() | |
| with open(path, "rb") as f: | |
| for chunk in iter(lambda: f.read(1 << 20), b""): | |
| h.update(chunk) | |
| return h.hexdigest() | |
| # ---------------------------------------------------------------- engines | |
| def run_bf16(clips, langs) -> dict: | |
| processor = AutoProcessor.from_pretrained(MODEL_ID) | |
| model = AutoModelForMultimodalLM.from_pretrained( | |
| MODEL_ID, device_map="cuda", dtype=torch.bfloat16 | |
| ).eval() | |
| warm = processor.apply_transcription_request( | |
| audio=str(HERE / "data" / clips[langs[0]][0]["audio"]), language=LANG_NAMES[langs[0]] | |
| ).to(model.device, dtype=model.dtype) | |
| with torch.inference_mode(): | |
| model.generate(**warm, max_new_tokens=32) | |
| rows = [] | |
| for lang in langs: | |
| for c in clips[lang]: | |
| wav = HERE / "data" / c["audio"] | |
| inp = processor.apply_transcription_request( | |
| audio=str(wav), language=LANG_NAMES[lang] | |
| ).to(model.device, dtype=model.dtype) | |
| torch.cuda.synchronize() | |
| t = time.time() | |
| with torch.inference_mode(): | |
| out = model.generate(**inp, max_new_tokens=512) | |
| torch.cuda.synchronize() | |
| dt = time.time() - t | |
| hyp = processor.decode( | |
| out[:, inp["input_ids"].shape[-1]:], return_format="transcription_only" | |
| )[0] | |
| rows.append({"id": c["id"], "lang": lang, "audio_s": sf.info(str(wav)).duration, | |
| "latency_s": dt, "ref": c["transcription"], "hyp": hyp}) | |
| print(f" bf16 {lang} {len(rows)}/{sum(len(v) for v in clips.values())} " | |
| f"{dt:.2f}s", flush=True) | |
| del model | |
| torch.cuda.empty_cache() | |
| return {"rows": rows} | |
| def run_gguf(clips, langs) -> dict: | |
| if LLAMA_SERVER is None: | |
| raise SystemExit("llama-server not found (README: build llama.cpp)") | |
| port = args.port | |
| log = open(HERE / "out" / f"bench-llama-server-{port}.log", "w") | |
| proc = subprocess.Popen([ | |
| LLAMA_SERVER, "-m", str(GGUF_DECODER), "--mmproj", str(GGUF_MMPROJ), | |
| "-ngl", "99", "-c", "4096", "-np", "1", "--temp", "0", "--jinja", | |
| "--host", "127.0.0.1", "--port", str(port), | |
| ], stdout=log, stderr=subprocess.STDOUT) | |
| url = f"http://127.0.0.1:{port}" | |
| try: | |
| for _ in range(1200): | |
| if proc.poll() is not None: | |
| raise SystemExit("llama-server exited (out/bench-llama-server.log)") | |
| try: | |
| if requests.get(url + "/health", timeout=1).status_code == 200: | |
| break | |
| except requests.RequestException: | |
| pass | |
| time.sleep(0.25) | |
| else: | |
| raise SystemExit("llama-server did not become ready") | |
| def transcribe(wav: Path, lang: str) -> tuple[str, float]: | |
| with open(wav, "rb") as f: | |
| t = time.time() | |
| r = requests.post( | |
| url + "/v1/audio/transcriptions", | |
| files={"file": (wav.name, f, "audio/wav")}, | |
| data={"language": ISO[lang], "temperature": "0"}, | |
| timeout=600, | |
| ) | |
| dt = time.time() - t | |
| r.raise_for_status() | |
| text = r.json().get("text", "") | |
| if text.lstrip().startswith("language "): | |
| text = text.split("<asr_text>", 1)[-1] | |
| return text.strip(), dt | |
| rows = [] | |
| for lang in langs: | |
| for c in clips[lang]: | |
| wav = HERE / "data" / c["audio"] | |
| hyp, dt = transcribe(wav, lang) | |
| rows.append({"id": c["id"], "lang": lang, "audio_s": sf.info(str(wav)).duration, | |
| "latency_s": dt, "ref": c["transcription"], "hyp": hyp}) | |
| print(f" gguf {lang} {len(rows)}/{sum(len(v) for v in clips.values())} " | |
| f"{dt:.2f}s", flush=True) | |
| return {"rows": rows} | |
| finally: | |
| proc.terminate() | |
| try: | |
| proc.wait(10) | |
| except subprocess.TimeoutExpired: | |
| proc.kill() | |
| log.close() | |
| # ---------------------------------------------------------------- stats | |
| def paired_ci(diff: list[float], n: int = 2000, seed: int = 7) -> tuple[float, float, float]: | |
| rng = random.Random(seed) | |
| means = [] | |
| for _ in range(n): | |
| means.append(statistics.mean(diff[rng.randrange(len(diff))] for _ in range(len(diff)))) | |
| means.sort() | |
| return statistics.mean(diff), means[int(0.025 * n)], means[int(0.975 * n)] | |
| def report(bf16: dict, gguf: dict, clips: dict, langs: list[str], extra: dict) -> str: | |
| for engine in (bf16, gguf): | |
| for r in engine["rows"]: | |
| r["score"] = score(r["ref"], r["hyp"], r["lang"]) | |
| b = {r["id"]: r for r in bf16["rows"]} | |
| lines = [ | |
| f"# Rumble-2-Flash GGUF accuracy benchmark", | |
| "", | |
| f"Generated {date.today()} on {extra['device']} · transformers {extra['transformers']} · " | |
| f"torch {extra['torch']} · llama.cpp {extra['llama_commit']}", | |
| "", | |
| "## Setup", | |
| "", | |
| f"- Data: FLEURS `test` split, {args.clips} utterances per language, deterministic sample " | |
| f"(seed {args.seed}): " + ", ".join(f"`{l}` ({len(clips[l])})" for l in langs) + ".", | |
| "- Reference: `Reson8/Rumble-2-Flash` BF16 in Transformers 5.23 on CUDA, greedy, forced language.", | |
| f"- Candidate: `{GGUF_DECODER.name}` + `{GGUF_MMPROJ.name}` through llama-server, " | |
| f"`-ngl 99`, greedy, forced language.", | |
| "- Scoring: Whisper normalizers (`EnglishTextNormalizer`, `BasicTextNormalizer`); character error " | |
| "rate for Chinese. Paired bootstrap over utterances, 2000 resamples, 95% interval.", | |
| "- The English spelling map is omitted from the normalizer (British/American spellings only).", | |
| "", | |
| "## Files", | |
| "", | |
| "| File | SHA-256 | Size |", | |
| "|---|---|---|", | |
| ] | |
| for p in (GGUF_DECODER, GGUF_MMPROJ): | |
| lines.append(f"| `{p.name}` | `{sha256(p)}` | {p.stat().st_size:,} bytes |") | |
| lines += [ | |
| "", | |
| "## Accuracy", | |
| "", | |
| "| Language | n | BF16 err % | GGUF err % | delta pp [95% CI] | transcripts changed |", | |
| "|---|---|---|---|---|---|", | |
| ] | |
| all_diff = [] | |
| for lang in langs: | |
| g = [r for r in gguf["rows"] if r["lang"] == lang] | |
| bb = [b[r["id"]] for r in g] | |
| bf = statistics.mean(r["score"] for r in bb) * 100 | |
| gf = statistics.mean(r["score"] for r in g) * 100 | |
| changed = sum(r["hyp"] != q["hyp"] for r, q in zip(g, bb)) | |
| diff = [r["score"] - q["score"] for r, q in zip(g, bb)] | |
| all_diff += diff | |
| mean, lo, hi = paired_ci(diff) | |
| lines.append(f"| {LANG_NAMES[lang]} | {len(g)} | {bf:.2f} | {gf:.2f} | " | |
| f"{mean*100:+.2f} [{lo*100:+.2f}, {hi*100:+.2f}] | {changed}/{len(g)} |") | |
| mean, lo, hi = paired_ci(all_diff) | |
| lines += [ | |
| f"| **pooled** | {len(all_diff)} | " | |
| f"{statistics.mean(r['score'] for r in bf16['rows'])*100:.2f} | " | |
| f"{statistics.mean(r['score'] for r in gguf['rows'])*100:.2f} | " | |
| f"{mean*100:+.2f} [{lo*100:+.2f}, {hi*100:+.2f}] | " | |
| f"{sum(r['hyp'] != b[r['id']]['hyp'] for r in gguf['rows'])}/{len(all_diff)} |", | |
| "", | |
| "## Latency (same run, GPU shared with other work — indicative only)", | |
| "", | |
| "| Engine | median s/clip | RTFx |", | |
| "|---|---|---|", | |
| ] | |
| for name, engine in (("BF16 transformers", bf16), ("GGUF llama.cpp", gguf)): | |
| rows = engine["rows"] | |
| lines.append(f"| {name} | {statistics.median(r['latency_s'] for r in rows):.2f} | " | |
| f"{sum(r['audio_s'] for r in rows)/sum(r['latency_s'] for r in rows):.1f} |") | |
| lines += [ | |
| "", | |
| "## Usage", | |
| "", | |
| "```bash", | |
| f"llama-server -m {GGUF_DECODER.name} --mmproj {GGUF_MMPROJ.name} \\", | |
| " -c 1024 -np 1 --temp 0 --jinja", | |
| "curl -F file=@clip.wav -F language=en -F temperature=0 \\", | |
| " http://127.0.0.1:8080/v1/audio/transcriptions", | |
| "```", | |
| "", | |
| "Long audio: the transcriptions endpoint does not segment; audio costs ~13 tokens/s, so", | |
| "`-c` must cover audio + transcript. A 285 s clip needs `-c 8192` (3726 prompt tokens, 812", | |
| "generated); at `-c 4096` the transcript is truncated. `-c 1024` fits ~60 s.", | |
| "", | |
| "## Limitations", | |
| "", | |
| "- FLEURS is read speech in 3-25 s clips; conversational and code-switched audio are not", | |
| " covered. Long-form works (see Usage) but is not scored here.", | |
| "- 100 utterances per language: intervals only exclude effects larger than roughly 1 pp pooled.", | |
| "- Language is forced, so language identification accuracy is not scored.", | |
| "- Latency is measured with other GPU work resident on the box; use it for ordering, not SLOs.", | |
| "- Absolute numbers are not comparable to the model card's Open ASR Leaderboard run (other", | |
| " splits and normalization); compare rows within this table.", | |
| "", | |
| "## Reproduce", | |
| "", | |
| "```bash", | |
| "hf download google/fleurs --repo-type dataset --local-dir data \\", | |
| " data/en_us/audio/test.tar.gz data/en_us/test.tsv \\", | |
| " data/es_419/audio/test.tar.gz data/es_419/test.tsv \\", | |
| " data/pt_br/audio/test.tar.gz data/pt_br/test.tsv \\", | |
| " data/de_de/audio/test.tar.gz data/de_de/test.tsv \\", | |
| " data/fr_fr/audio/test.tar.gz data/fr_fr/test.tsv \\", | |
| " data/cmn_hans_cn/audio/test.tar.gz data/cmn_hans_cn/test.tsv \\", | |
| " data/yue_hant_hk/audio/test.tar.gz data/yue_hant_hk/test.tsv", | |
| ".venv/bin/python bench_select.py --clips 100", | |
| ".venv/bin/python bench_release.py --clips 100", | |
| "```", | |
| "", | |
| "## Reading", | |
| "", | |
| "`delta pp` is GGUF minus BF16 on the same utterances; an interval covering 0 means no", | |
| "detectable difference at this sample size. `transcripts changed` counts byte-level", | |
| "differences, not errors.", | |
| ] | |
| return "\n".join(lines) + "\n" | |
| def _extra() -> dict: | |
| llama_commit = "unknown" | |
| try: | |
| llama_commit = subprocess.run( | |
| ["git", "-C", str(HERE / "../llama.cpp"), "rev-parse", "--short", "HEAD"], | |
| capture_output=True, text=True, check=True, | |
| ).stdout.strip() | |
| except (OSError, subprocess.CalledProcessError): | |
| pass | |
| return { | |
| "device": torch.cuda.get_device_name(0), | |
| "transformers": __import__("transformers").__version__, | |
| "torch": torch.__version__, | |
| "llama_commit": llama_commit, | |
| } | |
| def main() -> None: | |
| global args | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--clips-file", default=str(HERE / "data" / "bench_clips.json")) | |
| ap.add_argument("--clips", type=int, default=100) | |
| ap.add_argument("--seed", type=int, default=1234) | |
| ap.add_argument("--langs", default="en_us,es_419,pt_br,de_de,fr_fr,cmn_hans_cn,yue_hant_hk") | |
| ap.add_argument("--engines", default="bf16,gguf") | |
| ap.add_argument("--out-dir", default=str(HERE / "out" / "bench")) | |
| ap.add_argument("--report-only", action="store_true", help="rebuild REPORT.md from saved JSON") | |
| ap.add_argument("--gguf-decoder", help="decoder GGUF (default: auto-located)") | |
| ap.add_argument("--gguf-mmproj", help="mmproj GGUF (default: auto-located)") | |
| ap.add_argument("--llama-server", help="llama-server binary (default: ../llama.cpp/build*/bin or PATH)") | |
| ap.add_argument("--bf16-json", help="reuse BF16 transcripts from an earlier run instead of rerunning it") | |
| ap.add_argument("--port", type=int, default=7890, help="llama-server port for the GGUF run") | |
| args = ap.parse_args() | |
| global GGUF_DECODER, GGUF_MMPROJ, LLAMA_SERVER | |
| if args.gguf_decoder: | |
| GGUF_DECODER = Path(args.gguf_decoder) | |
| if args.gguf_mmproj: | |
| GGUF_MMPROJ = Path(args.gguf_mmproj) | |
| if args.llama_server: | |
| LLAMA_SERVER = args.llama_server | |
| out = Path(args.out_dir) | |
| out.mkdir(parents=True, exist_ok=True) | |
| clips = json.loads(Path(args.clips_file).read_text()) | |
| langs = args.langs.split(",") | |
| for lang in langs: | |
| clips[lang] = clips[lang][: args.clips] | |
| if args.report_only: | |
| bf16_path = Path(args.bf16_json) if args.bf16_json else out / "bf16.json" | |
| bf16 = json.loads(bf16_path.read_text()) | |
| gguf = json.loads((out / "gguf.json").read_text()) | |
| (out / "REPORT.md").write_text(report(bf16, gguf, clips, langs, _extra())) | |
| print((out / "REPORT.md").read_text()) | |
| return | |
| results = {"bf16": Path(args.bf16_json)} if args.bf16_json else {} | |
| if "bf16" in args.engines and not args.bf16_json: | |
| print("bf16 ...", flush=True) | |
| results["bf16"] = (out / "bf16.json") | |
| data = run_bf16(clips, langs) | |
| results["bf16"].write_text(json.dumps(data)) | |
| elif "bf16" not in results: | |
| results["bf16"] = out / "bf16.json" | |
| if "gguf" in args.engines: | |
| print("gguf ...", flush=True) | |
| results["gguf"] = (out / "gguf.json") | |
| data = run_gguf(clips, langs) | |
| results["gguf"].write_text(json.dumps(data)) | |
| else: | |
| results["gguf"] = out / "gguf.json" | |
| if not Path(results["bf16"]).is_file(): | |
| print(f"waiting for {results['bf16']} ...", flush=True) | |
| for _ in range(1200): | |
| if Path(results["bf16"]).is_file(): | |
| break | |
| time.sleep(0.5) | |
| bf16 = json.loads(results["bf16"].read_text()) | |
| gguf = json.loads(results["gguf"].read_text()) | |
| text = report(bf16, gguf, clips, langs, _extra()) | |
| (out / "REPORT.md").write_text(text) | |
| print(text) | |
| if __name__ == "__main__": | |
| main() | |