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.

Martelo-1, a decision model that decides in Brazilian Portuguese. An illustration of how it answers: it reads a text (an act of the Diário Oficial da União), gets a question about it (which ministry published the act) and gives each option a probability, marking the most probable one as decided

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.

How Martelo-1 answers the example in How to use. The text is a citizen's message: the street light in front of number 12 has been out for three weeks and nobody came. Three questions about it, each with the probability of every option. A choice, which municipal service it goes to: Iluminação pública, 0.998, decided. Yes or no, whether it is a complaint: Sim, 0.948, decided. A score, how urgent it is: Normal, the median level, 0.346; the true level is within one level of it with probability 0.806, below the 0.989 needed, so it is not decided and goes to a person

  • 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

Four rankings of Martelo-1, its base model S5-nano, 12 open decision models and Jev 1.14.0, each from best to worst. Which ministry a DOU act comes from: Martelo-1 first with 82.9 %, ahead of pplx-decider-v1.3 with 81.3. Procedure and formats in wordings and kinds never trained, in skill: Martelo-1 second with 58.8, after Shisa DE-2 with 63.0. The mean of the six public Portuguese benchmarks: Martelo-1 second with 77.2, after pplx-decider-v1.3 with 79.2. Prompt-injection success, where lower is better: Martelo-1 second with 18.0 %, after d3-flash with 17.7 %. Jev 1.14.0 places sixth, fifth, fourth and eighth; it was read on a hashed half of each test set, on which Martelo-1 reads 81.3, 58.0, 77.1 and 17.5 %

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¹

BenchmarkMartelo‑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.979.965.666.166.268.663.030.2
DOU: the act's type
1,285 items · 24 options
55.249.651.540.244.539.732.425.1
Brasil Participativo: which ministry a proposal goes to
1,482 items · 38 options
55.351.754.555.153.151.750.130.4
Brasil Participativo: the thematic axis of a proposal
1,480 items · 3 to 17 options
65.964.566.865.063.665.060.020.0
Public Portuguese benchmarks
HateBR
1,000 items · offensive comments · yes/no
89.188.282.286.180.081.772.171.8
ToLD-Br
832 items · toxic tweets · yes/no
76.676.171.671.070.073.665.361.3
ASSIN 2 RTE
1,701 items · textual entailment · yes/no
93.685.092.987.691.292.592.583.4
ASSIN 2 STS
1,688 items · sentence similarity · 5 levels
58.749.963.256.352.850.736.522.7
B2W-Reviews01
1,000 items · product review rating · 5 levels
52.651.350.053.552.450.751.624.0
Belebele (Portuguese)
635 items · reading comprehension · 4 options
92.890.294.892.893.174.589.833.7
Social bias
BBQ-PT
1,600 items · our Portuguese adaptation of BBQ · 3 options
99.497.194.294.082.887.485.328.6
Not seen in training
Procedure and formats
981 items · trained kinds in new wordings, three new kinds · skill, 0 = chance
58.816.937.531.519.814.515.52.9
Standard written Portuguese
1,000 items · hyphenation, number formats · yes/no
72.865.166.759.458.451.455.249.4
Attacks
Prompt-injection success
1,200 items · planted instructions followed · lower is better
18.054.539.532.236.430.827.056.8

Larger: 8B to 27B¹

BenchmarkMartelo‑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.981.381.073.673.078.471.7
DOU: the act's type
1,285 items · 24 options
55.267.258.857.048.848.147.8
Brasil Participativo: which ministry a proposal goes to
1,482 items · 38 options
55.355.555.656.055.153.353.3
Brasil Participativo: the thematic axis of a proposal
1,480 items · 3 to 17 options
65.969.067.768.768.065.668.5
Public Portuguese benchmarks
HateBR
1,000 items · offensive comments · yes/no
89.188.886.278.072.485.880.8
ToLD-Br
832 items · toxic tweets · yes/no
76.674.474.976.174.476.371.0
ASSIN 2 RTE
1,701 items · textual entailment · yes/no
93.694.293.093.492.191.491.4
ASSIN 2 STS
1,688 items · sentence similarity · 5 levels
58.766.963.663.158.051.453.4
B2W-Reviews01
1,000 items · product review rating · 5 levels
52.653.648.149.049.247.653.2
Belebele (Portuguese)
635 items · reading comprehension · 4 options
92.897.296.496.296.295.793.7
Social bias
BBQ-PT
1,600 items · our Portuguese adaptation of BBQ · 3 options
99.498.499.688.594.999.369.4
Not seen in training
Procedure and formats
981 items · trained kinds in new wordings, three new kinds · skill, 0 = chance
58.856.263.045.447.745.031.8
Standard written Portuguese
1,000 items · hyphenation, number formats · yes/no
72.882.093.863.066.874.154.0
Attacks
Prompt-injection success
1,200 items · planted instructions followed · lower is better
18.021.151.417.721.546.540.7
Notes
  1. 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.
  2. 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.

BenchmarkMartelo‑1
the same items
Jev 1.14.0
TypeSafe
Administrative records²
DOU: which ministry an act comes from
749 items · 33 options
81.373.6
DOU: the act's type
634 items · 24 options
59.054.3
Brasil Participativo: which ministry a proposal goes to
740 items · 38 options
54.154.9
Brasil Participativo: the thematic axis of a proposal
729 items · 3 to 17 options
67.870.6
Public Portuguese benchmarks
HateBR
509 items · offensive comments · yes/no
89.291.2
ToLD-Br
423 items · toxic tweets · yes/no
75.972.8
ASSIN 2 RTE
848 items · textual entailment · yes/no
93.294.6
ASSIN 2 STS
838 items · sentence similarity · 5 levels
58.952.5
B2W-Reviews01
499 items · product review rating · 5 levels
52.749.9
Belebele (Portuguese)
319 items · reading comprehension · 4 options
92.896.6
Social bias
BBQ-PT
772 items · our Portuguese adaptation of BBQ · 3 options
99.699.6
Not seen in training
Procedure and formats
503 items · trained kinds in new wordings, three new kinds · skill, 0 = chance
58.047.2
Standard written Portuguese
492 items · hyphenation, number formats · yes/no
74.563.9
Attacks
Prompt-injection success
563 items · planted instructions followed · lower is better
17.535.0

Against hosted decision APIs

On the same half as Jev.

BenchmarkMartelo‑1
the same items
d1-ultra
Liquid AI
gpt-6-luna
OpenAI
Gemini Decision 1
Google
Administrative records²
DOU: which ministry an act comes from
749 items · 33 options
81.384.185.886.6
DOU: the act's type
634 items · 24 options
59.069.768.973.3
Brasil Participativo: which ministry a proposal goes to
740 items · 38 options
54.158.657.256.6
Brasil Participativo: the thematic axis of a proposal
729 items · 3 to 17 options
67.869.869.471.2
Public Portuguese benchmarks
HateBR
509 items · offensive comments · yes/no
89.279.691.084.1
ToLD-Br
423 items · toxic tweets · yes/no
75.974.976.678.7
ASSIN 2 RTE
848 items · textual entailment · yes/no
93.295.393.491.3
ASSIN 2 STS
838 items · sentence similarity · 5 levels
58.963.864.769.9
B2W-Reviews01
499 items · product review rating · 5 levels
52.754.742.150.1
Belebele (Portuguese)
319 items · reading comprehension · 4 options
92.896.695.096.2
Social bias
BBQ-PT
772 items · our Portuguese adaptation of BBQ · 3 options
99.696.098.898.6
Not seen in training
Procedure and formats
503 items · trained kinds in new wordings, three new kinds · skill, 0 = chance
58.059.442.356.6
Standard written Portuguese
492 items · hyphenation, number formats · yes/no
74.580.577.891.9
Attacks
Prompt-injection success
563 items · planted instructions followed · lower is better
17.58.129.059.9

Tool use, safety and knowledge

Against its base model. The tool-use and safety tests are in English.

BenchmarkMartelo-1S5-nano
Tool use: When2Call
All tasks (3,423)77.154.5
… the right step is a tool call (1,295)86.387.3
… the right step is to ask the user (833)94.552.0
… the right step is to say no listed tool can do it (1,295)56.623.4
Safety screening
WildGuardTest: harmful request? (880)
F1
92.691.9
WildGuardTest: is the reply a refusal? (880)
F1
97.887.2
WildGuardTest: harmful reply? (880)
F1
89.283.1
XSTest: unsafe requests flagged (200)91.079.5
XSTest: safe requests flagged (250)
lower is better
6.04.0
JailbreakBench: plain harmful requests flagged (100)93.092.0
JailbreakBench: jailbreak prompts flagged (300)64.764.7
JailbreakBench: benign requests flagged (100)
lower is better
23.018.0
Knowledge
ENEM (286)
exam questions · 5 options
74.575.9
Global-MMLU (2,843)
Portuguese · 4 options
69.565.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-classification pipeline, or serve it through a generic decision endpoint such as vLLM's own /v1/systemone: in production, use the server in server/ (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.85 is 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 container nvcr.io/nvidia/vllm:26.11-py3 (vLLM 0.33), the version tested.
  • Requests: the state and questions of the Python example, as JSON, to http://127.0.0.1:8091/v1/systemone. Each answer has choice, confidence, probabilities and decided. The format, the limits and the settings are in server/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.py takes 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
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for fabriciocarraro/Martelo-1

Finetuned
(4)
this model
Quantizations
1 model

Space using fabriciocarraro/Martelo-1 1