Text Generation
Transformers
English
French
reasoning
chain-of-thought
structured-generation
function-calling
agentic
edge
small-language-model
Eval Results (legacy)
Instructions to use AMFORGE/samg-reasoning-checkpoints with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AMFORGE/samg-reasoning-checkpoints with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AMFORGE/samg-reasoning-checkpoints")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AMFORGE/samg-reasoning-checkpoints", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AMFORGE/samg-reasoning-checkpoints with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AMFORGE/samg-reasoning-checkpoints" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AMFORGE/samg-reasoning-checkpoints", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AMFORGE/samg-reasoning-checkpoints
- SGLang
How to use AMFORGE/samg-reasoning-checkpoints with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "AMFORGE/samg-reasoning-checkpoints" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AMFORGE/samg-reasoning-checkpoints", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "AMFORGE/samg-reasoning-checkpoints" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AMFORGE/samg-reasoning-checkpoints", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AMFORGE/samg-reasoning-checkpoints with Docker Model Runner:
docker model run hf.co/AMFORGE/samg-reasoning-checkpoints
File size: 3,440 Bytes
d383b89 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | ---
license: apache-2.0
language:
- en
- fr
library_name: transformers
pipeline_tag: text-generation
tags:
- reasoning
- chain-of-thought
- structured-generation
- function-calling
- agentic
- edge
- small-language-model
base_model: AMFORGE/samg
model-index:
- name: SAM-G-Reasoning
results:
- task:
type: multi-step-reasoning
name: Verified multi-step reasoning (12 families, held-out)
metrics:
- type: exact_match
value: 77.8
name: Exact match, aggregate (%)
---
# SAM-G-Reasoning
**SAM-G-Reasoning** is a 30.3M-parameter model fine-tuned from
[SAM-G](https://huggingface.co/AMFORGE/samg) on 196k verified multi-step
reasoning traces and action plans. It emits explicit step-by-step traces
(`step 1: ... step 2: ... Answer: X`) for questions and ordered JSON plans for
multi-step instructions. Built by **AMEFORGE** for procedural reasoning on the
edge.
- **Parameters:** 30.3M · **Footprint:** 121 MB fp32 · **Base:** SAM-G
- **Fine-tuning:** prompt-masked SFT (loss on the reasoning span only), cosine
8e-5, 8k steps
- **Aggregate exact-match:** 77.8% (held-out, disjoint seed)
## What it is good at — and what it is not
The model was stress-tested on twelve verified families. The pattern is clear:
it excels at **procedural** reasoning (following steps, tracking state, chaining
actions) and is limited on **calculation-heavy** tasks, as expected at 30M
parameters.
| Family | Exact % | Type |
|---|---|---|
| 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_track (device toggles)** | **83** | **working memory** |
| parity_digits | 58 | mixed |
| count_filter | 67 | calculation |
| sort_list | 50 | calculation |
| word_problem | 50 | calculation |
| arith_chain | 42 | calculation |
State-tracking at 83% is notable for this scale — it requires maintaining a
mutable state across several operations. Arithmetic-chain and sorting plateau
because exact multi-digit calculation is not reliably learnable at 30M; for
those, delegate to a tool rather than the model.
## Intended use
Agentic control loops: decompose an instruction into ordered steps, track
execution state, and emit structured action plans — entirely offline. Best used
as the **planning and state-tracking layer** of an agent, with arithmetic and
data lookups delegated to deterministic tools.
## Usage
```python
import sentencepiece as spm, torch
sp = spm.SentencePieceProcessor(); sp.Load("samg_tokenizer.model")
prompt = "states: lamp=off, fan=on. ops: toggle lamp, turn off fan, toggle lamp. final state of lamp? [CHAT]"
ids = torch.tensor([sp.EncodeAsIds(prompt)])
# greedy-decode -> "step 1: ... step 2: ... step 3: ... Answer: off"
```
## Limitations
- Calculation-heavy families (arithmetic, sorting, word problems) plateau at
42–50%; do not use for exact math — delegate to tools.
- Reasoning traces are synthetic, drawn from the training distribution family
with a disjoint evaluation seed.
- Not a general assistant; inherits the base model's knowledge limits.
## Citation
```bibtex
@misc{samgreasoning2026,
title = {SAM-G-Reasoning: Procedural Multi-Step Reasoning at 30M Parameters},
author = {AMEFORGE Lab},
year = {2026}
}
``` |