Foundation Model · 2026
SAM-G
Structured Action Model. A compact dual-mode model for offline, on-device action generation. The foundation behind Foros and GearCut.
What SAM-G does
SAM-G operates in two explicit modes. Given an instruction, it produces a structured action. Given a question, it produces a natural-language answer. Mode selection is automatic: the model learns to route, it does not need to be told which mode to use.
This dual-mode design makes SAM-G a practical drop-in for the tool-calling stage of agentic pipelines. It handles ten application domains natively: robotics, HTTP, MQTT, databases, workflows, e-commerce, vehicles, smart home, calendar, and file systems. It operates in English and French.
The model runs entirely offline. There is no cloud dependency, no API call, and no latency overhead from network round-trips. It is designed for deployment on edge hardware, including Raspberry Pi-class CPUs.
Capability comparison
SAM-G is the only sub-200M model that produces valid structured output zero-shot across all ten domains. General-purpose models up to 30 times its size score 0% on most domains even with few-shot prompting. Specialization, not scale, drives structured-emission accuracy.
| Model | Scale | Exact match | Efficiency (Exact/M params) |
|---|---|---|---|
| SAM-GOURS | 30.3M | 76% | 2.51 |
| Pythia-70M | 70M | 0% | 0.00 |
| SmolLM2-360M | 362M | 14% | 0.04 |
| Qwen2.5-0.5B | 494M | 25% | 0.05 |
| Qwen2.5-1.5B | 889M | 21% | 0.024 |
General baselines evaluated with 3-shot prompting. SAM-G evaluated zero-shot.
Domain coverage
SAM-G achieves perfect coverage on five of ten domains. The ROS domain, which requires floating-point speed, angle, and duration values, is the hardest schema and is addressed by Foros, a specialized finetune with dedicated robotics training.
Variant
SAM-G-Reasoning
SAM-G-Reasoning extends the base model with explicit step-by-step reasoning. It emits a visible reasoning trace before producing its answer or action plan, making it well-suited for agentic control loops where interpretability and state-tracking matter. It excels at procedural tasks and saturates logic, planning, and conversion families.
| Capability | Score | Category |
|---|---|---|
| Logic (ponens/tollens/chains) | 100% | Procedural |
| Plan chain (multi-step actions) | 100% | Procedural |
| Conversion (unit chains) | 100% | Procedural |
| Sequence (next term) | 100% | Procedural |
| Date/time (clock/calendar) | 92% | Procedural |
| Compare (max/min) | 92% | Procedural |
| State tracking (device toggles) | 83% | Working memory |
| Parity/digits | 58% | Mixed |
| Count/filter | 67% | Calculation |
| Sort list | 50% | Calculation |
| Word problem | 50% | Calculation |
| Arithmetic chain | 42% | Calculation |
| Aggregate | 77.8% |
SAM-G-CobraTooling
A 30.3M-parameter fine-tune of SAM-G-Reasoning on 196k agentic orchestration traces. It turns a natural-language instruction into an ordered, risk-flagged JSON plan of tool calls — the local orchestration layer of the CobraBub IDE, running fully offline in 121 MB.
Stress-tested on thirteen families (held-out eval, disjoint seed), with an aggregate exact plan-match of 78.8%. Routing, exit-code reaction, git, scraping and SQL routing are saturated; long strictly-ordered chains remain the hard ceiling at 30M parameters. We publish the numbers and the demo, not the internals.
| FAMILY | TYPE | EXACT % |
|---|---|---|
| single_tool (routing) | Routing | 100% |
| retry_loop (exit-code reaction) | Reaction | 100% |
| feedback_react (stdout/stderr) | Reaction | 100% |
| git_workflow (status→add→push) | Procedural | 100% |
| scrape_research (fetch→summarize→act) | Procedural | 100% |
| db_query (SQL routing) | Structured call | 100% |
| webhook_wait (async callback) | Async reaction | 92% |
| mcp_call (filesystem/github/postgres) | Structured call | 83% |
| api_call (REST/GraphQL) | Structured call | 75% |
| plan_chain (multi-step plans) | Planning | 58% |
| risk_gate (safe/critical gating) | Gated planning | 58% |
| fs_watch (file-change reaction) | Async reaction | 42% |
| build_test_cycle (long chains) | Long chain | 17% |
| Aggregate | 78.8% |
Built on SAM-G
SAM-G is the foundation model powering Ameforge's production deployments. Foros and GearCut are both specialized variants of SAM-G, inheriting its structured-emission capability and offline operation, then fine-tuned for their respective domains.
Citation
@misc{samg2026,
title = {SAM-G: A Dual-Mode Language Model
for Offline Structured Action Generation},
author = {Amega Mike, AMEFORGE Lab},
year = {2026}
}