Mercury-1.7B Banner

Mercury-1.7B

rrchat/Mercury-1.7B is an open-weights, high-efficiency multi-task reasoning, coding, and agentic vision-language model fine-tuned on top of Liquid AI's LiquidAI/LFM3-VL-2B architecture (~1.7B active language parameters + SigLIP Vision encoder).

Mercury combines the efficiency of constant-state linear attention and causal convolutions with bilingual step-by-step reasoning, strict identity alignment (Mercury by rrchat), and zero degradation on Berkeley Function Calling (BFCL v4).

Looking for quantized GGUF weights for llama.cpp / Ollama?
👉 rrchat/Mercury-1.7B-GGUF


🌟 Key Highlights & Capabilities

  • Modern LFM3 Hybrid Architecture: Utilizes causal 1D depthwise short convolutions ($k=7$) combined with gated linear self-attention layers, delivering extreme throughput (~180–200+ tokens/sec on consumer GPUs) with low memory footprint.
  • Natural Alignment & Conversation: Polished for helpful, direct bilingual interaction (Russian & English) without conversational artifacts or repetitive self-checking loops.
  • Parity on Agentic Tool Calling: Preserves 97.0% accuracy on the Berkeley Function Calling Benchmark (BFCL v4), supporting structured XML-inline tool execution.
  • Bilingual Reasoning & Coding: Fine-tuned on curated high-quality mathematical reasoning (OpenR1-Math-220k), agentic multi-turn trajectories (Nemotron-SFT-Agentic-v2), programming datasets (OpencodeInstruct), and high-register Russian dialog (GrandMaster-PRO-MAX).
  • Full Multimodal Compatibility: Vision projection layers and SigLIP image processing pipelines are fully preserved for zero-shot image understanding and document analysis.

🧪 Benchmark Highlights (vs. Base Model)

All benchmarks were evaluated locally on an identical test harness under strictly identical conditions:

Benchmark Generation Mode Base (LFM3-VL-2B) Mercury-1.7B Delta vs. Base Domain / Capability
HumanEval / LiveCodeBench Thinking (<think>) 25.0% 40.0% +15.0% Python coding & algorithmic reasoning
HumanEval / LiveCodeBench Instant (Direct) 65.0% 70.0% +5.0% Fast code generation & syntax adherence
GSM8K (Grade School Math) Thinking (<think>) 75.0% 80.0% +5.0% Multi-step mathematical reasoning
IFEval (Instruction Following) Thinking (<think>) 70.0% 72.5% +2.5% Complex system constraint compliance
BFCL v4 (Tool Use) Thinking / Instant 97.0% 97.0% Parity (0% loss) Berkeley Function Calling / Agentic Tool Calls
IFEval (Instruction Following) Instant (Direct) 75.0% 74.2% Parity (~74%) Direct formatting & negative constraint compliance
Claw-Eval General Instant (Direct) 91.7% 91.7% Parity (>90%) Real-world conversational quality

Disclaimer on Evaluations:
All benchmarks presented above were conducted manually and independently on local test suites under controlled, reproducible conditions. The results reflect real-world local execution performance and may differ from theoretical or officially reported figures published on the official Liquid AI LFM3 model card.


💻 Quickstart (Transformers / Python)

This repository includes custom model implementation files (configuration_lfm3.py, modeling_lfm3.py, processing_lfm3_vl.py). Always specify trust_remote_code=True when loading:

1. Text Inference

import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer

model_id = "rrchat/Mercury-1.7B"

tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True
)

prompt = "Привет! Кто ты и чем можешь помочь?"
messages = [
    {"role": "user", "content": prompt}
]

formatted_text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)

inputs = tokenizer(formatted_text, return_tensors="pt").to(model.device)

outputs = model.generate(
    **inputs,
    max_new_tokens=512,
    temperature=0.7,
    top_p=0.9,
    do_sample=True
)

response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)

2. Multimodal Vision Inference (Image + Text)

import torch
from PIL import Image
from transformers import AutoProcessor, AutoModelForImageTextToText

model_id = "rrchat/Mercury-1.7B"

processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True
)

image = Image.open("sample.jpg").convert("RGB")
prompt = "<|image|>Опиши подробно, что изображено на этой фотографии."

messages = [
    {"role": "user", "content": prompt}
]

formatted_prompt = processor.tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)

inputs = processor(text=formatted_prompt, images=image, return_tensors="pt").to(model.device)

outputs = model.generate(
    **inputs,
    max_new_tokens=512,
    temperature=0.3
)

response = processor.tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)

🛠️ Tool Calling / Agentic Function Calling

Mercury-1.7B adheres to the structured XML-parameter protocol:

<tool_call>
<function=get_current_weather>
<parameter=location>
Moscow, Russia
</parameter>
<parameter=unit>
celsius
</parameter>
</function>
</tool_call>

Tool responses are fed back via the tool role:

<|im_start|>tool
{"temperature": 18, "condition": "Cloudy"}
<|im_end|>

📜 Citation & Credits

If you use Mercury-1.7B in your research or applications, please cite:

@misc{mercury2026rrchat,
  author = {rrchat team},
  title = {Mercury-1.7B: High-Efficiency Hybrid Reasoning and Agentic Vision-Language Model},
  year = {2026},
  publisher = {Hugging Face},
  journal = {Hugging Face repository},
  howpublished = {\url{https://huggingface.co/rrchat/Mercury-1.7B}}
}

Special recognition to the Liquid AI team for the foundational LFM3-VL-2B architecture.

Downloads last month
26
Safetensors
Model size
2B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for rrchat/Mercury-1.7B

Finetuned
(10)
this model

Datasets used to train rrchat/Mercury-1.7B

Collection including rrchat/Mercury-1.7B