Run this model with HF Jobs
Run fabriciocarraro/Martelo-1 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/fabriciocarraro/Martelo-1. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/fabriciocarraro/Martelo-1 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use fabriciocarraro/Martelo-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fabriciocarraro/Martelo-1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="fabriciocarraro/Martelo-1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("fabriciocarraro/Martelo-1") model = AutoModelForCausalLM.from_pretrained("fabriciocarraro/Martelo-1", device_map="auto") - Notebooks
- Google Colab
- Kaggle

Base model · Results · How to use · Limitations
A decision model for Brazilian Portuguese, fine-tuned from maritaca-ai/S5-nano. It reads a state (a text or a JSON value) and answers typed questions about it (a choice, yes or no, or a score), each with a calibrated probability. It generates no text.
An independent project by Fabrício Carraro, not an official Maritaca AI release.

- Best of its size. Ahead of each of the 15 open decision models of up to 4B on the public Portuguese benchmarks, the records and BBQ-PT alike (paired 95 % intervals all above zero).
- Against larger models. On routing official acts (which ministry a DOU act comes from) it has the highest score of all 26 open decision models, 82.9 %, level with the 27B pplx-decider-v1.3 (81.3 %); planted instructions sway it about as little as the best of them (18.0 % of answers; Wald-26B-A4B 17.4 %).
- Knows when to ask. On When2Call it asks for the missing information in 94.5 % of the tasks that need it (S5-nano 52.0 %).
- Calibrated, small and fast. Every answer carries a probability and a "decided" flag; 4.2B parameters, 165 ms for one question on a 3,000-token text on one H100.
Results

All items come from test splits that Martelo-1 never trained on. Accuracy in %, unless the row says otherwise; bold marks the best of each row.
Against open decision models
We read 26 open decision models; the tables show 12 of them, and note 1 names the others.
Of its size: up to 4B¹
| Benchmark | Martelo‑1 4B | S5‑nano 4B · base model | pplx-decider-flash-v1.3 4B | h2o-lightning-4b 4B | decider-4b 4B · PT-BR board | kev-4b 4B · PT-BR board | d1-3B 3B | laya-multilingual 0.3B |
|---|---|---|---|---|---|---|---|---|
| Administrative records² | ||||||||
| DOU: which ministry an act comes from 1,500 items · 33 options | 82.9 | 79.9 | 65.6 | 66.1 | 66.2 | 68.6 | 63.0 | 30.2 |
| DOU: the act's type 1,285 items · 24 options | 55.2 | 49.6 | 51.5 | 40.2 | 44.5 | 39.7 | 32.4 | 25.1 |
| Brasil Participativo: which ministry a proposal goes to 1,482 items · 38 options | 55.3 | 51.7 | 54.5 | 55.1 | 53.1 | 51.7 | 50.1 | 30.4 |
| Brasil Participativo: the thematic axis of a proposal 1,480 items · 3 to 17 options | 65.9 | 64.5 | 66.8 | 65.0 | 63.6 | 65.0 | 60.0 | 20.0 |
| Public Portuguese benchmarks | ||||||||
| HateBR 1,000 items · offensive comments · yes/no | 89.1 | 88.2 | 82.2 | 86.1 | 80.0 | 81.7 | 72.1 | 71.8 |
| ToLD-Br 832 items · toxic tweets · yes/no | 76.6 | 76.1 | 71.6 | 71.0 | 70.0 | 73.6 | 65.3 | 61.3 |
| ASSIN 2 RTE 1,701 items · textual entailment · yes/no | 93.6 | 85.0 | 92.9 | 87.6 | 91.2 | 92.5 | 92.5 | 83.4 |
| ASSIN 2 STS 1,688 items · sentence similarity · 5 levels | 58.7 | 49.9 | 63.2 | 56.3 | 52.8 | 50.7 | 36.5 | 22.7 |
| B2W-Reviews01 1,000 items · product review rating · 5 levels | 52.6 | 51.3 | 50.0 | 53.5 | 52.4 | 50.7 | 51.6 | 24.0 |
| Belebele (Portuguese) 635 items · reading comprehension · 4 options | 92.8 | 90.2 | 94.8 | 92.8 | 93.1 | 74.5 | 89.8 | 33.7 |
| Social bias | ||||||||
| BBQ-PT 1,600 items · our Portuguese adaptation of BBQ · 3 options | 99.4 | 97.1 | 94.2 | 94.0 | 82.8 | 87.4 | 85.3 | 28.6 |
| Not seen in training | ||||||||
| Procedure and formats 981 items · trained kinds in new wordings, three new kinds · skill, 0 = chance | 58.8 | 16.9 | 37.5 | 31.5 | 19.8 | 14.5 | 15.5 | 2.9 |
| Standard written Portuguese 1,000 items · hyphenation, number formats · yes/no | 72.8 | 65.1 | 66.7 | 59.4 | 58.4 | 51.4 | 55.2 | 49.4 |
| Attacks | ||||||||
| Prompt-injection success 1,200 items · planted instructions followed · lower is better | 18.0 | 54.5 | 39.5 | 32.2 | 36.4 | 30.8 | 27.0 | 56.8 |
Larger: 8B to 27B¹
| Benchmark | Martelo‑1 4B | pplx-decider-v1.3 27B | shisa-de-2 26B, 4B active | d3-flash 9B | elephant-1 9B | rune-26b-a4b-v3† 26B, 4B active | clef-flash 9B |
|---|---|---|---|---|---|---|---|
| Administrative records² | |||||||
| DOU: which ministry an act comes from 1,500 items · 33 options | 82.9 | 81.3 | 81.0 | 73.6 | 73.0 | 78.4 | 71.7 |
| DOU: the act's type 1,285 items · 24 options | 55.2 | 67.2 | 58.8 | 57.0 | 48.8 | 48.1 | 47.8 |
| Brasil Participativo: which ministry a proposal goes to 1,482 items · 38 options | 55.3 | 55.5 | 55.6 | 56.0 | 55.1 | 53.3 | 53.3 |
| Brasil Participativo: the thematic axis of a proposal 1,480 items · 3 to 17 options | 65.9 | 69.0 | 67.7 | 68.7 | 68.0 | 65.6 | 68.5 |
| Public Portuguese benchmarks | |||||||
| HateBR 1,000 items · offensive comments · yes/no | 89.1 | 88.8 | 86.2 | 78.0 | 72.4 | 85.8 | 80.8 |
| ToLD-Br 832 items · toxic tweets · yes/no | 76.6 | 74.4 | 74.9 | 76.1 | 74.4 | 76.3 | 71.0 |
| ASSIN 2 RTE 1,701 items · textual entailment · yes/no | 93.6 | 94.2 | 93.0 | 93.4 | 92.1 | 91.4 | 91.4 |
| ASSIN 2 STS 1,688 items · sentence similarity · 5 levels | 58.7 | 66.9 | 63.6 | 63.1 | 58.0 | 51.4 | 53.4 |
| B2W-Reviews01 1,000 items · product review rating · 5 levels | 52.6 | 53.6 | 48.1 | 49.0 | 49.2 | 47.6 | 53.2 |
| Belebele (Portuguese) 635 items · reading comprehension · 4 options | 92.8 | 97.2 | 96.4 | 96.2 | 96.2 | 95.7 | 93.7 |
| Social bias | |||||||
| BBQ-PT 1,600 items · our Portuguese adaptation of BBQ · 3 options | 99.4 | 98.4 | 99.6 | 88.5 | 94.9 | 99.3 | 69.4 |
| Not seen in training | |||||||
| Procedure and formats 981 items · trained kinds in new wordings, three new kinds · skill, 0 = chance | 58.8 | 56.2 | 63.0 | 45.4 | 47.7 | 45.0 | 31.8 |
| Standard written Portuguese 1,000 items · hyphenation, number formats · yes/no | 72.8 | 82.0 | 93.8 | 63.0 | 66.8 | 74.1 | 54.0 |
| Attacks | |||||||
| Prompt-injection success 1,200 items · planted instructions followed · lower is better | 18.0 | 21.1 | 51.4 | 17.7 | 21.5 | 46.5 | 40.7 |
Notes
- Read as released. Those marked "PT-BR board" come from the PT-BR typed-decisions board; the others are multilingual. Also read: bobcat-flash-1.2, hopper-g, JevK5, jpt-4b, kev-0.8b, laya-pt-es-typed, lev, metask-jev-rain-12B-trained, NeoHorse-Jev-4B, pplx-decider-flash-v1.2, saracura-ptbr-4b, StandardOne-8B, synack-decide-26b-a4b and Wald-26B-A4B. No model of up to 4B left out of the first table beats its best score on any row. In the second, a model left out scores better on three rows: bobcat-flash-1.2 on the BP ministry (57.6) and BBQ-PT (99.7), and Wald-26B-A4B on prompt injections (17.4). Some of these models may have trained on these benchmarks. † rune-26b-a4b-v3: its own repository is gone; the link goes to a copy of the same weights.
- Acts of the Diário Oficial da União (DOU) and citizens' proposals on Brasil Participativo (BP), with the record's own field as the answer.
Against Jev 1.14.0
On half of each test set, with Martelo-1 on the same items.
| Benchmark | Martelo‑1 the same items | Jev 1.14.0 TypeSafe |
|---|---|---|
| Administrative records² | ||
| DOU: which ministry an act comes from 749 items · 33 options | 81.3 | 73.6 |
| DOU: the act's type 634 items · 24 options | 59.0 | 54.3 |
| Brasil Participativo: which ministry a proposal goes to 740 items · 38 options | 54.1 | 54.9 |
| Brasil Participativo: the thematic axis of a proposal 729 items · 3 to 17 options | 67.8 | 70.6 |
| Public Portuguese benchmarks | ||
| HateBR 509 items · offensive comments · yes/no | 89.2 | 91.2 |
| ToLD-Br 423 items · toxic tweets · yes/no | 75.9 | 72.8 |
| ASSIN 2 RTE 848 items · textual entailment · yes/no | 93.2 | 94.6 |
| ASSIN 2 STS 838 items · sentence similarity · 5 levels | 58.9 | 52.5 |
| B2W-Reviews01 499 items · product review rating · 5 levels | 52.7 | 49.9 |
| Belebele (Portuguese) 319 items · reading comprehension · 4 options | 92.8 | 96.6 |
| Social bias | ||
| BBQ-PT 772 items · our Portuguese adaptation of BBQ · 3 options | 99.6 | 99.6 |
| Not seen in training | ||
| Procedure and formats 503 items · trained kinds in new wordings, three new kinds · skill, 0 = chance | 58.0 | 47.2 |
| Standard written Portuguese 492 items · hyphenation, number formats · yes/no | 74.5 | 63.9 |
| Attacks | ||
| Prompt-injection success 563 items · planted instructions followed · lower is better | 17.5 | 35.0 |
Against hosted decision APIs
On the same half as Jev.
| Benchmark | Martelo‑1 the same items | d1-ultra Liquid AI | gpt-6-luna OpenAI | Gemini Decision 1 |
|---|---|---|---|---|
| Administrative records² | ||||
| DOU: which ministry an act comes from 749 items · 33 options | 81.3 | 84.1 | 85.8 | 86.6 |
| DOU: the act's type 634 items · 24 options | 59.0 | 69.7 | 68.9 | 73.3 |
| Brasil Participativo: which ministry a proposal goes to 740 items · 38 options | 54.1 | 58.6 | 57.2 | 56.6 |
| Brasil Participativo: the thematic axis of a proposal 729 items · 3 to 17 options | 67.8 | 69.8 | 69.4 | 71.2 |
| Public Portuguese benchmarks | ||||
| HateBR 509 items · offensive comments · yes/no | 89.2 | 79.6 | 91.0 | 84.1 |
| ToLD-Br 423 items · toxic tweets · yes/no | 75.9 | 74.9 | 76.6 | 78.7 |
| ASSIN 2 RTE 848 items · textual entailment · yes/no | 93.2 | 95.3 | 93.4 | 91.3 |
| ASSIN 2 STS 838 items · sentence similarity · 5 levels | 58.9 | 63.8 | 64.7 | 69.9 |
| B2W-Reviews01 499 items · product review rating · 5 levels | 52.7 | 54.7 | 42.1 | 50.1 |
| Belebele (Portuguese) 319 items · reading comprehension · 4 options | 92.8 | 96.6 | 95.0 | 96.2 |
| Social bias | ||||
| BBQ-PT 772 items · our Portuguese adaptation of BBQ · 3 options | 99.6 | 96.0 | 98.8 | 98.6 |
| Not seen in training | ||||
| Procedure and formats 503 items · trained kinds in new wordings, three new kinds · skill, 0 = chance | 58.0 | 59.4 | 42.3 | 56.6 |
| Standard written Portuguese 492 items · hyphenation, number formats · yes/no | 74.5 | 80.5 | 77.8 | 91.9 |
| Attacks | ||||
| Prompt-injection success 563 items · planted instructions followed · lower is better | 17.5 | 8.1 | 29.0 | 59.9 |
Tool use, safety and knowledge
Against its base model. The tool-use and safety tests are in English.
| Benchmark | Martelo-1 | S5-nano |
|---|---|---|
| Tool use: When2Call | ||
| All tasks (3,423) | 77.1 | 54.5 |
| … the right step is a tool call (1,295) | 86.3 | 87.3 |
| … the right step is to ask the user (833) | 94.5 | 52.0 |
| … the right step is to say no listed tool can do it (1,295) | 56.6 | 23.4 |
| Safety screening | ||
| WildGuardTest: harmful request? (880) F1 | 92.6 | 91.9 |
| WildGuardTest: is the reply a refusal? (880) F1 | 97.8 | 87.2 |
| WildGuardTest: harmful reply? (880) F1 | 89.2 | 83.1 |
| XSTest: unsafe requests flagged (200) | 91.0 | 79.5 |
| XSTest: safe requests flagged (250) lower is better | 6.0 | 4.0 |
| JailbreakBench: plain harmful requests flagged (100) | 93.0 | 92.0 |
| JailbreakBench: jailbreak prompts flagged (300) | 64.7 | 64.7 |
| JailbreakBench: benign requests flagged (100) lower is better | 23.0 | 18.0 |
| Knowledge | ||
| ENEM (286) exam questions · 5 options | 74.5 | 75.9 |
| Global-MMLU (2,843) Portuguese · 4 options | 69.5 | 65.4 |
On the PT-BR typed-decisions board, its V3 index is 57.05 (S5-nano 53.60), self-reported.
How to use
example.py, in this repository, reads questions the way the served model does: it gives the same answer on 596 of 600 test questions. It needs Python 3.10 or later and a GPU with 16 GB.
pip install torch "transformers>=5" huggingface_hub
hf download fabriciocarraro/Martelo-1 example.py --local-dir .
from example import Martelo
model = Martelo() # downloads fabriciocarraro/Martelo-1
state = ("Bom dia. Há três semanas o poste de luz em frente ao número 12 "
"da Rua Principal não acende, e à noite o trecho fica completamente "
"escuro. Avisei a prefeitura há quinze dias e até agora ninguém "
"apareceu.")
questions = {
"area": {
"type": "choice",
"instructions": ("Para qual serviço municipal a mensagem "
"deve ser enviada?"),
"criteria": {"iluminacao": "Iluminação pública",
"limpeza": "Limpeza urbana",
"obras": "Obras e vias públicas",
"tributos": "Tributos e IPTU"},
},
"reclamacao": {"type": "noul",
"instructions": "A mensagem é uma reclamação?"},
"urgencia": {"type": "score",
"instructions": "Qual é a urgência da mensagem?",
"criteria": ["Baixa", "Normal", "Alta", "Urgente"]},
}
answers = model.decide(state, questions)
for name, answer in answers.items():
print(name, answer["choice"], f"{answer['confidence']:.3f}",
"decided" if answer["decided"] else "not decided")
# area iluminacao 0.998 decided
# reclamacao true 0.948 decided
# urgencia 1 0.346 not decided (level 1: "Normal")
type |
criteria |
the answer's choice |
|---|---|---|
choice |
option id → description, 2 or more | the most probable option |
noul (yes/no) |
none | "true" or "false" |
score |
the levels, in order, 2 to 10 | the index of the median level |
- Decided answers reach a 1 % error rate on the development set; send the others to a person.
- Read, don't generate. Don't call
generate(), use Transformers'text-classificationpipeline, or serve it through a generic decision endpoint such as vLLM's own/v1/systemone: in production, use the server inserver/(below). - Phrase the options in words, and offer "O texto não diz" when the state may not settle the question.
In production: the server in server/
server/ holds the server Martelo-1 is served with: vLLM behind POST /v1/systemone, the request format of Jev and other decision APIs, with the readout of example.py. It reads a request's text once for all its questions and answers up to 32 requests at once. On a DGX Spark it gave the served model's answer to 1,628 of 1,630 test questions under load, and to all 400 test documents of 16,000 to 32,000 tokens.
hf download fabriciocarraro/Martelo-1 --local-dir martelo-1
docker build -t martelo-server martelo-1/server
docker run -d --name martelo --gpus all --ipc=host -p 8091:8091 \
-e GPU_MEMORY_UTILIZATION=0.85 \
-v "$PWD/martelo-1":/models/martelo-1:ro martelo-server
python3 martelo-1/server/check_server.py --url http://127.0.0.1:8091
- Needs: one GPU and Docker with the NVIDIA Container Toolkit. The server takes about 13 GiB of GPU memory for prompts of up to 32,768 tokens.
GPU_MEMORY_UTILIZATION=0.85is for a GPU of your own; on a shared machine leave it out (the default is 0.30). The image builds on NVIDIA's vLLM containernvcr.io/nvidia/vllm:26.11-py3(vLLM 0.33), the version tested. - Requests: the
stateandquestionsof the Python example, as JSON, tohttp://127.0.0.1:8091/v1/systemone. Each answer haschoice,confidence,probabilitiesanddecided. The format, the limits and the settings are inserver/README.md. - Speed: 165 ms for one question on a 3,000-token text on an H100. On a DGX Spark, 201 ms for three questions on a short message and 2.3 s for twenty on a 4,000-token text (
example.pytakes 76 s for that one). - No authentication: keep it on an internal network.
Model details
| Base model | maritaca-ai/S5-nano |
| Parameters | 4.2B (bf16, 8.4 GB) |
| Architecture | Qwen3.5 (hybrid attention) |
| Context | tested up to 32,768 tokens |
| Languages | Brazilian Portuguese, English |
| Speed | 165 ms per question on one H100, served with vLLM |
| Release | 2 Dec 2026 |
| Training | LoRA fine-tunes on 214,778 decision items, 89.5 % in Brazilian Portuguese |
Intended use: routing, classifying and checking texts in Brazilian public administration and services; choosing an assistant's next step with tools; screening requests and replies. Not meant for: generating text, open questions, or decisions about people without human oversight.
Limitations
- Knowledge. Questions that need facts the state does not give are its weak side (ENEM 74.5 %, Global-MMLU 69.5 %).
- Computations (interest, instalments) are unreliable: compute them in code.
- Scores are coarse: on B2W the exact level is right 52.6 % of the time, within one level 93.7 %.
- Safety screening lets about one jailbreak in three through: use it as one layer of a guardrail.
- Planted instructions: it still follows 18.0 % of the instructions planted in the state.
- European Portuguese was not evaluated.
License
Apache-2.0, the same as its base model, S5-nano.
Citation
@misc{carraro2026martelo1,
title = {Martelo-1: a decision model for Brazilian public administration},
author = {Carraro, Fabrício},
year = {2026},
url = {https://huggingface.co/fabriciocarraro/Martelo-1}
}
Contact
Fabrício Carraro: contato@fabriciocarraro.com.br
- Downloads last month
- 47