Specifications
Problem Solving
Step-by-step math
Edge Deployment
Tiny model footprint
Education
Tutoring and explanations
Quick Start
- Transformers
- llama.cpp
Install:Run:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
🚀 New: LFM2-24B-A2B — our largest model is now available! Learn more →
350M parameter model for math problem solving
| Property | Value |
|---|---|
| Parameters | 350M |
| Context Length | 32K tokens |
| Task | Mathematical Reasoning |
pip install "transformers>=5.0.0" torch accelerate
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "LiquidAI/LFM2-350M-Math"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
messages = [
{"role": "user", "content": "If a train travels at 60 mph for 2.5 hours, how far does it travel?"}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", return_dict=True).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
hf download LiquidAI/LFM2-350M-Math-GGUF \
--local-dir ./LFM2-350M-Math-GGUF
llama-cli -m ./LFM2-350M-Math-GGUF/LFM2-350M-Math-Q4_K_M.gguf \
-p "Solve: 2x + 5 = 15"
Was this page helpful?