nsalerni commited on
Commit
6be6a93
·
verified ·
1 Parent(s): 1c61063

release: flowcast-v4-lite — 809MB stack, 100% benchmarks, IR v5 push5

Browse files
README.md ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model:
4
+ - mlx-community/LFM2.5-1.2B-Instruct-4bit
5
+ - mlx-community/functiongemma-270m-it-4bit
6
+ tags:
7
+ - mlx
8
+ - lfm2
9
+ - functiongemma
10
+ - lora
11
+ - voice-agent
12
+ - desktop-automation
13
+ - computer-use
14
+ - flowcast
15
+ - gemmaflow
16
+ - apple-silicon
17
+ - compact-ir
18
+ library_name: mlx-lm
19
+ pipeline_tag: text-generation
20
+ ---
21
+
22
+ # flowcast-v4-lite · sub-1GB voice agent stack
23
+
24
+ **Flowcast v4-lite** is an **809 MB** hot-path stack for macOS voice agents. It builds on [`flowcast-v3-lite`](https://huggingface.co/nsalerni/flowcast-v3-lite) with a promoted LFM2.5 writer, IR v5 push5 planner, transcript-first automation repairs, and intent fast-path routing.
25
+
26
+ > *100% benchmark accuracy. Faster dictation. IR v5 fallback when repairs miss.*
27
+
28
+ ## Benchmarks (vs v3-lite)
29
+
30
+ | Gate | v3-lite | v4-lite | Δ |
31
+ |------|---------|---------|---|
32
+ | Core overall | 100% | **100%** | tie |
33
+ | Expanded overall | 100% | **100%** | tie |
34
+ | Held-out overall | 100% | **100%** | tie |
35
+ | Dictation p50 | 360 ms | **208 ms** | **-152 ms** |
36
+ | Core avg latency | 116 ms | **78 ms** | **-38 ms** |
37
+ | IR model path p50 | 793 ms | **453 ms** | **-340 ms** |
38
+ | Hot download | ~809 MB | **~809 MB** | same |
39
+
40
+ Production automation resolves via deterministic transcript repairs and intent fast-path (0 IR calls on the hot path). IR v5 is exercised on the fallback model path.
41
+
42
+ ## Architecture
43
+
44
+ ```
45
+ spoken command
46
+ → transcript-first repairs + intent fast-path (dominant, ~0 ms)
47
+ → FunctionGemma IR v5 (~270M + 5MB adapter, fallback)
48
+ → compact JSON intent
49
+ → transcript-aware compiler
50
+ → DesktopAutomationPlan JSON
51
+
52
+ spoken dictation / intent
53
+ → LFM2.5 writer (~1.2B + 42MB adapter, KV-cached prefix)
54
+ → polished text or intent label
55
+ ```
56
+
57
+ ## Quick start
58
+
59
+ ```bash
60
+ pip install mlx-lm huggingface_hub gemmaflow-tune
61
+ ```
62
+
63
+ ```python
64
+ from huggingface_hub import snapshot_download
65
+ from mlx_lm import load, generate
66
+ from gemmaflow_tune.compact_ir import compact_ir_prompt, parse_compact_ir, repair_compact_ir, compile_compact_ir
67
+
68
+ bundle = snapshot_download("nsalerni/flowcast-v4-lite")
69
+ writer_base = snapshot_download("mlx-community/LFM2.5-1.2B-Instruct-4bit")
70
+ ir_base = snapshot_download("mlx-community/functiongemma-270m-it-4bit")
71
+
72
+ writer_model, writer_tok = load(writer_base, adapter_path=f"{bundle}/writer")
73
+ ir_model, ir_tok = load(ir_base, adapter_path=f"{bundle}/ir")
74
+
75
+ # Automation: IR → compiler (fallback path)
76
+ transcript = "open codex and create a new thread in my loudink project"
77
+ ir_prompt = compact_ir_prompt(transcript)
78
+ ir_out = generate(ir_model, ir_tok, prompt=ir_prompt, max_tokens=96)
79
+ ir = repair_compact_ir(parse_compact_ir(ir_out), transcript)
80
+ plan = compile_compact_ir(ir, transcript=transcript)
81
+ print(plan)
82
+ ```
83
+
84
+ ## Files
85
+
86
+ | File | Description |
87
+ |------|-------------|
88
+ | `writer/adapters.safetensors` | LFM2.5 writer LoRA (`promoted_core_100`) |
89
+ | `writer/adapter_config.json` | Writer LoRA config |
90
+ | `ir/adapters.safetensors` | FunctionGemma IR v5 push5 LoRA |
91
+ | `ir/adapter_config.json` | IR LoRA config |
92
+ | `inference_config.json` | Runtime settings + benchmark scores |
93
+ | `manifest.json` | Production manifest for GemmaFlow integration |
94
+
95
+ ## Recommended inference settings
96
+
97
+ ```json
98
+ {
99
+ "runner_kind": "compact_ir",
100
+ "prompt_mode": "verbose",
101
+ "json_early_stop": true,
102
+ "writer_use_prompt_kv_cache": true,
103
+ "ir_use_prompt_kv_cache": true,
104
+ "transcript_first_ir": true,
105
+ "intent_fast_path": true,
106
+ "temperature": 0.0,
107
+ "top_p": 1.0,
108
+ "ir_max_tokens": 96,
109
+ "dictation_max_tokens": 192
110
+ }
111
+ ```
112
+
113
+ ## Training lineage
114
+
115
+ Fine-tuned with [gemmaflow-tune](https://github.com/nsalerni/finetune-rl-gemma):
116
+
117
+ - Writer base: `mlx-community/LFM2.5-1.2B-Instruct-4bit`
118
+ - IR base: `mlx-community/functiongemma-270m-it-4bit`
119
+ - Method: LoRA on both models + deterministic transcript compiler + push5 IR corpus
120
+ - Predecessor: [`nsalerni/flowcast-v3-lite`](https://huggingface.co/nsalerni/flowcast-v3-lite)
121
+
122
+ ## Citation
123
+
124
+ ```bibtex
125
+ @misc{flowcastv4lite2026,
126
+ title = {flowcast-v4-lite: Sub-1GB Voice Desktop Automation for GemmaFlow},
127
+ author = {Salerni, Nicola},
128
+ year = {2026},
129
+ url = {https://huggingface.co/nsalerni/flowcast-v4-lite}
130
+ }
131
+ ```
132
+
133
+ ## License
134
+
135
+ Apache 2.0. Base models subject to their respective licenses (LFM2.5, FunctionGemma/Gemma).
inference_config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_name": "flowcast-v4-lite",
3
+ "model_tag": "flowcast-v4-lite",
4
+ "runner_kind": "compact_ir",
5
+ "hf_repo": "nsalerni/flowcast-v4-lite",
6
+ "predecessor": "nsalerni/flowcast-v3-lite",
7
+ "writer_base_model": "mlx-community/LFM2.5-1.2B-Instruct-4bit",
8
+ "ir_base_model": "mlx-community/functiongemma-270m-it-4bit",
9
+ "writer_adapter_path": "writer",
10
+ "ir_adapter_path": "ir",
11
+ "writer_checkpoint": "adapters.safetensors",
12
+ "writer_use_prompt_kv_cache": true,
13
+ "ir_checkpoint": "adapters.safetensors",
14
+ "ir_use_prompt_kv_cache": true,
15
+ "transcript_first_ir": true,
16
+ "intent_fast_path": true,
17
+ "prompt_mode": "verbose",
18
+ "json_early_stop": true,
19
+ "heavy_fallback": false,
20
+ "ir_max_tokens": 96,
21
+ "download_mb": 809,
22
+ "benchmarks": {
23
+ "core_overall": 1.0,
24
+ "expanded_overall": 1.0,
25
+ "held_out_overall": 1.0,
26
+ "core_automation": 1.0,
27
+ "core_web_routing": 1.0,
28
+ "core_generalization": 1.0,
29
+ "core_intent": 1.0,
30
+ "core_dictation": 1.0,
31
+ "core_latency_accuracy": 1.0,
32
+ "core_latency_p50_ms": 0,
33
+ "dictation_p50_ms": 208,
34
+ "core_avg_ms": 78,
35
+ "held_out_avg_ms": 152,
36
+ "vs_v3_lite_dict_p50_delta_ms": -152,
37
+ "latency_sla_ms": 2000,
38
+ "benchmarked_at": "2026-06-26"
39
+ }
40
+ }
ir/adapter_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fine_tune_type": "lora",
3
+ "role": "compact_ir",
4
+ "model_hf_repo": "mlx-community/functiongemma-270m-it-4bit",
5
+ "checkpoint": "adapters.safetensors",
6
+ "num_layers": 12,
7
+ "lora_parameters": {
8
+ "keys": [
9
+ "self_attn.q_proj",
10
+ "self_attn.k_proj",
11
+ "self_attn.v_proj",
12
+ "self_attn.o_proj",
13
+ "mlp.gate_proj",
14
+ "mlp.up_proj",
15
+ "mlp.down_proj"
16
+ ],
17
+ "rank": 8,
18
+ "scale": 16.0,
19
+ "dropout": 0.05
20
+ },
21
+ "training_pipeline": "gemmaflow-tune FunctionGemma IR v5 push5 compact-intent distill"
22
+ }
ir/adapters.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:231afdddd1fc709d3858ff26dedf7953fb6ec982214fea9a51c5ba5f0755548b
3
+ size 5080337
manifest.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "product": "v4-lite",
3
+ "version": "1.0.0",
4
+ "download_mb": 809,
5
+ "runner_kind": "compact_ir",
6
+ "writer_model_config": "configs/model_v5_lfm25_1_2b.yaml",
7
+ "writer_adapter_path": "artifacts/sft_v5_lfm25_v3lite_writer/adapters",
8
+ "writer_checkpoint": "promoted_core_100.safetensors",
9
+ "writer_use_prompt_kv_cache": true,
10
+ "ir_model_config": "configs/model_v4_functiongemma.yaml",
11
+ "ir_adapter_path": "artifacts/sft_v5_functiongemma_ir_v5/adapters",
12
+ "ir_checkpoint": "adapters.safetensors",
13
+ "ir_prompt_mode": "verbose",
14
+ "ir_use_prompt_kv_cache": true,
15
+ "ir_max_tokens": 96,
16
+ "transcript_first_ir": true,
17
+ "intent_fast_path": true,
18
+ "prompt_mode": "verbose",
19
+ "json_early_stop": true,
20
+ "heavy_fallback": false,
21
+ "predecessor": "nsalerni/flowcast-v3-lite",
22
+ "targets": {
23
+ "core_accuracy": 0.99,
24
+ "expanded_accuracy": 0.99,
25
+ "held_out_accuracy": 0.97,
26
+ "hot_download_mb_max": 850,
27
+ "core_latency_p50_ms_max": 350
28
+ },
29
+ "notes": "v3-lite stack + promoted writer checkpoint + IR v5 push5; production uses transcript-first + intent fast-path; IR v5 exercised on fallback path (IR model slice)."
30
+ }
writer/adapter_config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fine_tune_type": "lora",
3
+ "role": "writer",
4
+ "model_hf_repo": "mlx-community/LFM2.5-1.2B-Instruct-4bit",
5
+ "checkpoint": "promoted_core_100.safetensors",
6
+ "num_layers": 16,
7
+ "lora_parameters": {
8
+ "keys": [
9
+ "self_attn.q_proj",
10
+ "self_attn.k_proj",
11
+ "self_attn.v_proj",
12
+ "self_attn.out_proj",
13
+ "conv.in_proj",
14
+ "conv.out_proj",
15
+ "feed_forward.w1",
16
+ "feed_forward.w2",
17
+ "feed_forward.w3"
18
+ ],
19
+ "rank": 16,
20
+ "scale": 32.0,
21
+ "dropout": 0.05
22
+ },
23
+ "training_pipeline": "gemmaflow-tune v5 cascade \u2192 core promotion \u2192 dictation KV cache"
24
+ }
writer/adapters.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ceb709ccf7a40ea608c5cc74c247071bbcb0980017f1811f7c55604b4241ab7c
3
+ size 44453426