AmeforgeAmeforge

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.

100%
Valid structured output
76%
Exact match, zero-shot
50×
Efficiency vs. best baseline
Offline
No cloud dependency

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.

ModelScaleExact matchEfficiency (Exact/M params)
SAM-GOURS30.3M76%2.51
Pythia-70M70M0%0.00
SmolLM2-360M362M14%0.04
Qwen2.5-0.5B494M25%0.05
Qwen2.5-1.5B889M21%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.

HTTP
100%
MQTT
100%
Database
100%
E-commerce
100%
Vehicle
100%
Calendar
80%
Workflow
60%
File System
60%
Smart Home
50%
ROS
0%

Variant

SAM-G-Reasoning

HuggingFace

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.

CapabilityScoreCategory
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/digits58%Mixed
Count/filter67%Calculation
Sort list50%Calculation
Word problem50%Calculation
Arithmetic chain42%Calculation
Aggregate77.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.

FAMILYTYPEEXACT %
single_tool (routing)Routing100%
retry_loop (exit-code reaction)Reaction100%
feedback_react (stdout/stderr)Reaction100%
git_workflow (status→add→push)Procedural100%
scrape_research (fetch→summarize→act)Procedural100%
db_query (SQL routing)Structured call100%
webhook_wait (async callback)Async reaction92%
mcp_call (filesystem/github/postgres)Structured call83%
api_call (REST/GraphQL)Structured call75%
plan_chain (multi-step plans)Planning58%
risk_gate (safe/critical gating)Gated planning58%
fs_watch (file-change reaction)Async reaction42%
build_test_cycle (long chains)Long chain17%
Aggregate78.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}
}