/ Модель

Характеристики

Контекст
262 144 токена
Параметры
1,6 млрд
Лицензия
Своя лицензия
Архитектура
lfm3 · dense
Базовая модель
LFM3-1.7B
Библиотека
transformers
Опубликована
26 ноя 2026

LFM3-1.7B-BR

Генерация текстаТекст → текст12 профессий
400скачиваний за 30 дней23лайкавеса обновлены1 дек 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Дообученная на бразильском португальском компактная модель LFM3 для агентов с инструментами и задач по предоставленному контексту.

LFM3-1.7B-BR — независимая дообученная Fabrício Carraro модель LiquidAI/LFM3-1.7B для агентных сценариев и задач на основе предоставленного контекста. Это плотная гибридная текстовая архитектура LFM3 с 1,73 млрд параметров: 13 gated short convolution-блоков, 5 слоёв скользящего внимания и 6 слоёв глобального внимания. Контекстное окно составляет 262 144 токена, хотя при постобучении использовались последовательности до 16 384 токенов.

Модель предназначена для вызова инструментов, следования инструкциям и обработки переданного контекста: поиска с RAG, извлечения данных в JSON, суммаризации, классификации и перефразирования. Есть режимы с рассуждением и без него; настройка ориентирована прежде всего на бразильский португальский, также проверялись английские инструкции. По данным автора, дообучение улучшило структурированный вывод, следование инструкциям и результаты на тестах бразильской культуры относительно базовой модели.

Модель менее подходит для открытого диалога, вопросов, требующих обширных знаний без поиска, и некоторых длинных запросов без режима рассуждения: ответы могут продолжаться до предела контекста. Также отмечены чрезмерные отказы на части безвредных агентных задач и снижение качества на отдельных английских агентных тестах. Лицензия указана как other; проект независимый и не является официальным релизом Liquid AI.

Сценарии применения

  • вызов инструментов в агентных сценариях
  • ответы по документам с использованием RAG
  • извлечение полей и формирование JSON
  • суммаризация длинного предоставленного текста
  • классификация и перефразирование по инструкции
  • следование инструкциям на бразильском португальском

Ограничения

Для вопросов, требующих обширных знаний, рекомендуется использовать поиск: компактная модель уступает более крупным моделям в фактических знаниях. В длинных запросах без режима рассуждения возможны незавершённые ответы; также встречаются чрезмерные отказы на безвредных агентных задачах и более слабые результаты на некоторых английских агентных тестах.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит12

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

A Brazilian Portuguese post-training of LiquidAI/LFM3-1.7B for agents with tools, tasks over provided context and instruction following, in thinking and non-thinking modes.

An independent community project by Fabrício Carraro. It is not an official Liquid AI release.

  • Best agentic-safety score in its class (Lumen PT): 98.1 with thinking and 98.8 without, with explicit refusals instead of inaction.
  • Usable non-thinking mode: in multi-turn or few-shot prompts without thinking, the base model often writes </think> mid-answer (e.g. Não</think>Não), even with Liquid's recommended setup. It also wraps some JSON answers in invented tool calls. This fine-tune fixes both:
    • Structured Output: 86.8 → 95.8;
    • ASSIN 2: 1.3 → 91.3. The 1.3 is almost all format: with the tag removed, the base model scores 87.3.
  • Better instruction following without thinking: English IFEval +12.5, IFBench +5.9.
  • Brazilian culture: BRoverbs +17.7 with thinking and +18.2 without, over the base model.

Results

Portuguese tests come from the public Observatório Maritaca harness. Each table covers one mode; the best score in each row is in bold.

Portuguese, with thinking (the default mode)

Portuguese, without thinking

The LFM3-1.7B scores on the unjudged Observatório tests are the official campaign's. Everything else was generated by us on vLLM. Against the base model, these differences are significant (paired bootstrap, 95% CI): with thinking, the gain on BRoverbs and the loss on Prosa-PT (−3.4); without thinking, the gains on Structured Output, ASSIN 2 and BRoverbs.

Notes on the Portuguese tables

  1. Gemma 4 E2B has 2.3B "effective" parameters (5.1B with embeddings).
  2. MiniCPM5-2B has 2.5B parameters.
  3. Judged by a local DeepSeek-V4.1-Flash-1017 with the harness's original judge prompts and rules. It is stricter than the GPT-4.1 judge of the official Observatório campaign, so these scores are not comparable with the published ones. Prosa-PT without thinking, LFM3-1.7B-BR: mean over 980 of 981 conversations (one judgment failed).
  4. Output capped at 64k tokens.
  5. 111 text-only questions of the 2026 exam, held after our 7 Nov 2026 data cutoff, scored with a provisional answer key. With 111 questions, the 95% CI is about ±8 points.
  6. Almost all format: the base model writes </think> mid-answer in this few-shot prompt. With the tag removed, it scores 87.3.

English

Tests from Liquid's card, against the base model; the rivals were not measured in English. Bold marks the significantly better model within each mode (paired bootstrap, 95% CI); no bold means a tie.

Without thinking, IFEval, IFBench and BFCL irrelevance improve; τ³-bench in both modes, BFCL irrelevance with thinking and RULER without thinking get worse. BFCL and τ³-bench ran with local substitutes for paid components, so they are not comparable with Liquid's published numbers.

Model details

Base modelLiquidAI/LFM3-1.7B, revision ac2586a34f1a1c03329dbdcdefabd8b6478ddaa7
Parameters1.73B; architecture unchanged (hybrid: 13 gated short convolutions, 5 sliding-window and 6 global attention layers)
Context length262,144 tokens; post-training used sequences of up to 16,384
Weightsbf16
LanguagesBrazilian Portuguese (target), English
ModesThinking (default) and non-thinking, selected through the chat template
FilesOnly model.safetensors was modified. The configuration, tokenizer, chat template, generation config and Liquid's modeling code are the base model's, unchanged

Intended use: tool-using agents; tasks over provided context (RAG, extraction to JSON, summarization, classification, rewriting); instruction following; non-thinking mode when latency matters.

Not recommended for: knowledge-heavy questions without retrieval, and open-ended chat where quality matters more than speed (see "Limitations").

How to run

vLLM (v0.34.0 or later):

vllm serve fabriciocarraro/LFM3-1.7B-BR \
  --dtype bfloat16 --max-model-len 262144 \
  --reasoning-parser qwen3 \
  --enable-auto-tool-choice --tool-call-parser qwen3_coder

The LFM3 template writes tool calls in the qwen3_coder format, and vLLM has no LFM-specific parser. We used these two parsers in all our evaluations.

from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
resp = client.chat.completions.create(
    model="fabriciocarraro/LFM3-1.7B-BR",
    messages=[{"role": "user", "content": "Resuma em uma frase: ..."}],
    extra_body={"chat_template_kwargs": {"enable_thinking": False}},  # True (default) = thinking mode
)
print(resp.choices[0].message.content)

Transformers (with Liquid's remote code):

from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "fabriciocarraro/LFM3-1.7B-BR"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo, dtype="bfloat16", trust_remote_code=True)
msgs = [{"role": "user", "content": "Qual é a capital de Pernambuco?"}]
inputs = tok.apply_chat_template(msgs, add_generation_prompt=True, enable_thinking=False,
                                 return_tensors="pt", return_dict=True)
out = model.generate(**inputs, max_new_tokens=256)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Tool calling. Pass the tools in OpenAI format. The model answers with a <tool_call> block, which vLLM's qwen3_coder parser returns in tool_calls:

tools = [{"type": "function", "function": {
    "name": "consultar_clima",
    "description": "Consulta a previsão do tempo de uma cidade brasileira",
    "parameters": {"type": "object", "properties": {"cidade": {"type": "string"}}, "required": ["cidade"]},
}}]
msgs = [{"role": "user", "content": "Vai chover em Recife hoje?"}]
inputs = tok.apply_chat_template(msgs, tools=tools, add_generation_prompt=True, enable_thinking=False,
                                 return_tensors="pt", return_dict=True)
out = model.generate(**inputs, max_new_tokens=256)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
# <tool_call>
# <function=consultar_clima>
# <parameter=cidade>
# Recife
# </parameter>
# </function>
# </tool_call>

Sampling. The bundled generation_config.json (from the base model) sets temperature=0.1, top_k=50, repetition_penalty=1.1, Liquid's recommendation for general use. For math, Liquid recommends temperature=1.0, top_p=0.95, top_k=20.

Training

We did not redo Liquid's post-training. Starting from LFM3-1.7B:

  1. a narrow SFT (68k examples): output format, tool use, agentic refusals paired with benign look-alike tasks, culture, context tasks and English replay;
  2. on-policy distillation, with the base model as the teacher for conversation, to keep its chat quality;
  3. DPO on the model's own answers, judged with per-prompt rubrics;
  4. three rounds of GRPO with verifiable rewards (instructions, agent decisions, math, tool calls, not calling irrelevant tools, over-refusal), each followed by a short distillation from the base model to repair conversation;
  5. a final broad repair distillation.

Whenever a verifier existed, the training targets were the model's own answers. Gemma 4 26B-A4B wrote refusals, reference answers and agent scenarios. Checkpoints were chosen on development sets kept apart from the tests.

Decontamination: every training example and every teacher prompt was checked against all Observatório tests, the ENEM bank, the English originals of translated tests and our dev sets, by n-grams and by embeddings (bge-m3). Nothing was collected from the web after 7 Nov 2026. All training data was also checked against the 2026 ENEM questions; nothing matched.

Safety

  • Explicit refusal: on Lumen's harmful agentic scenarios, the model refuses explicitly in 97.1% of attempts with thinking and 98.7% without, and takes a harmful action in 1.9% and 1.2%. The base model refuses in 46.3% in both modes; much of its "safe" score is inaction (34.0% without thinking). Gemma 4 E2B refuses in 80.1% with thinking and 75.7% without.
  • Over-refusal: without thinking, the model refuses 16.0% of benign agentic tasks in our dev set (base model: 0.2%), and 6.7% with thinking. Its benign success rate matches the base model's, because refusals replace inaction.
  • HarmBench has not been run yet.

Limitations

  • Conversation: open-ended chat is slightly worse than the base model's with thinking (Prosa-PT −3.4). Gemma 4 E2B is better at it.
  • Long inputs without thinking: the model sometimes reasons aloud in the answer and never ends its turn. On LongBench v2, 75 of 487 answers ran to the 262K-token limit (base model: 23). Use thinking mode or cap max_tokens for long inputs.
  • Agents in English: τ³-bench is 5 points lower than the base model's, with more hand-offs to a human agent.
  • Knowledge: it remains a 1.7B model; larger rivals know more facts. Use retrieval for knowledge-heavy tasks.
  • Reasoning language: reasoning stays mostly in English; final answers are almost always in Portuguese.
  • Leaked </think> without thinking: 0 in our quick tests (50 prompts), but 3.8% of samples at temperature 0.7 on multiple-choice prompts.
  • Evaluation: single runs per test and one local judge. Some defects were first seen on test results of intermediate models and then fixed with new dev sets, so a few tests (MATH-PT, BFCL, Prosa-PT) are not fully blind.

License

This model is a Derivative Work of LFM3-1.7B, distributed under the LFM Open License v1.0 (the LICENSE file is the base model's, unchanged). Commercial use is licensed only for entities with annual revenue under US$10M. Only model.safetensors was modified. No training data is redistributed here.

Citation

@misc{carraro2026lfm3br,
  title  = {LFM3-1.7B-BR: Brazilian Portuguese post-training of LFM3-1.7B},
  author = {Carraro, Fabrício},
  year   = {2026},
  url    = {https://huggingface.co/fabriciocarraro/LFM3-1.7B-BR}
}

@article{liquidAI2026LFM3,
  author  = {Liquid AI},
  title   = {Introducing LFM3: Every Modality for Specialized Intelligence},
  journal = {Liquid AI Blog},
  year    = {2026},
  note    = {www.liquid.ai/blog/lfm3},
}

Evaluation harness: Observatório Maritaca.

Contact

Fabrício Carraro: contato@fabriciocarraro.com.br

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

Модели нужен код из репозитория; запуск откроется после проверки совместимости.

Класс архитектуры
Lfm3ForCausalLM
Ревизия весов
713d418

0 моделей