Downloads · 30 days
32
2% of all-time downloads
Kirim-ai/Kirim-1-Math
Kirim-1-Math is a text generation model from Kirim-ai. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
32
2% of all-time downloads
All-time downloads
1.7K
Public
Parameters
16.2B
60 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors60 GB · 100%
From the Hugging Face model README
The First Kirim Model with Advanced Mathematical Reasoning and Tool Calling
</div>Kirim-1-Math is a 16-billion parameter mathematical reasoning model, representing a major leap in the Kirim model series. As the first Kirim model with tool calling capabilities, it combines advanced mathematical problem-solving with the ability to use external tools and execute calculations.
| Parameter | Value | Comparison |
|---|---|---|
| Parameters | 16B | 2.3× larger than base |
| Hidden Size | 5,120 | Enhanced capacity |
| Layers | 48 | Deep reasoning |
| Attention Heads | 40 | Fine-grained attention |
| KV Heads | 8 (GQA) | Memory efficient |
| Context Length | 32,768 tokens | Extended problems |
| Vocabulary | 102,400 | Same as base |
| Tool Calling | ✅ Yes | New feature! |
| Precision | BFloat16 | High quality |
pip install transformers torch accelerate sympy
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model
model = AutoModelForCausalLM.from_pretrained(
"Kirim-ai/Kirim-1-Math",
torch_dtype="auto",
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
"Kirim-ai/Kirim-1-Math",
trust_remote_code=True
)
# Solve a math problem
messages = [
{"role": "user", "content": "Solve the quadratic equation: x² - 5x + 6 = 0"}
]
inputs = tokenizer.apply_chat_template(
messages,
return_tensors="pt",
add_generation_prompt=True
).to(model.device)
outputs = model.generate(
inputs,
max_new_tokens=2048,
temperature=0.1, # Lower temperature for math
top_p=0.95,
do_sample=False # Deterministic for accuracy
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Kirim-1-Math is the first Kirim model with built-in tool calling capabilities.
The model can use these built-in mathematical tools:
messages = [
{
"role": "user",
"content": "Calculate 2^1024 and tell me how many digits it has"
}
]
# Model will automatically decide to use calculator tool
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
outputs = model.generate(inputs, max_new_tokens=2048)
# Response will include tool calls like:
# <tool_call>
# {
# "name": "calculator",
# "arguments": {
# "expression": "2**1024"
# }
# }
# </tool_call>
tools = [
{
"type": "function",
"function": {
"name": "scientific_calculator",
"description": "Perform advanced scientific calculations",
"parameters": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "Mathematical expression to evaluate"
},
"precision": {
"type": "integer",
"description": "Decimal precision",
"default": 10
}
},
"required": ["expression"]
}
}
}
]
# Include tools in prompt
messages = [
{"role": "system", "content": f"You have access to these tools: {tools}"},
{"role": "user", "content": "Calculate sin(π/4) with 15 decimal places"}
]
# Example: Solve system of equations
problem = """
解方程组:
2x + 3y = 12
4x - y = 5
"""
response = model.generate_solution(problem)
# Output includes step-by-step solution with reasoning
# Integration
problem = "Calculate: ∫(x³ + 2x² - x + 1)dx"
# Differentiation
problem = "Find dy/dx if y = ln(x²) + e^(3x)"
problem = """
A bag contains 5 red balls and 3 blue balls.
What's the probability of drawing 2 red balls without replacement?
"""
problem = "Prove that √2 is irrational"
# Model provides formal mathematical proof
problem = """
In triangle ABC, if AB = 5, BC = 7, and AC = 8,
find the area using Heron's formula.
"""
messages = [
{
"role": "user",
"content": "I don't understand how to complete the square. Can you explain and show an example?"
}
]
# Provides step-by-step explanations
messages = [
{
"role": "user",
"content": "Help me verify this proof about convergence of infinite series"
}
]
# Analyzes mathematical proofs
messages = [
{
"role": "user",
"content": "Solve these 10 calculus problems and show your work"
}
]
# Solves problems with detailed steps
messages = [
{
"role": "user",
"content": "Give me 5 AMC-level problems to practice"
}
]
# Generates practice problems
messages = [
{
"role": "user",
"content": "Use numerical methods to find roots of x^5 - 3x^3 + 2x - 1 = 0"
}
]
# Writes and executes numerical solver
The model shows its work:
Problem: Solve x² - 5x + 6 = 0
Solution:
Step 1: Identify this as a quadratic equation in standard form ax² + bx + c = 0
where a=1, b=-5, c=6
Step 2: Try factoring: We need two numbers that multiply to 6 and add to -5
Those numbers are -2 and -3
Step 3: Factor: (x - 2)(x - 3) = 0
Step 4: Apply zero product property:
x - 2 = 0 or x - 3 = 0
Step 5: Solve each equation:
x = 2 or x = 3
Answer: x = 2 or x = 3
# Request LaTeX formatted output
messages = [
{
"role": "user",
"content": "Solve this and format the answer in LaTeX: ∫(x² + 1)/(x³ + 3x + 1)dx"
}
]
# Output includes:
# $$\int \frac{x^2 + 1}{x^3 + 3x + 1}dx = ...$$
Uses SymPy internally for symbolic computation:
from sympy import symbols, expand, factor, simplify
# Model can perform:
# - Expansion: (x+1)³ → x³ + 3x² + 3x + 1
# - Factoring: x² - 4 → (x-2)(x+2)
# - Simplification: (x²-1)/(x-1) → x+1
Minimum (4-bit Quantization):
Recommended (BF16):
Optimal (Production):
# 8-bit (30GB VRAM)
model = AutoModelForCausalLM.from_pretrained(
"Kirim-ai/Kirim-1-Math",
load_in_8bit=True,
device_map="auto"
)
# 4-bit (20GB VRAM)
model = AutoModelForCausalLM.from_pretrained(
"Kirim-ai/Kirim-1-Math",
load_in_4bit=True,
device_map="auto"
)
Mathematics Corpus: 500B tokens
Code: 200B tokens
General: 800B tokens
Total: 1.5 Trillion tokens
Stage 1: Continued Pre-training (from Kirim-V1-base)
Stage 2: Mathematical Instruction Tuning
Stage 3: Tool Calling Training
Stage 4: Reinforcement Learning
| Model | Parameters | Purpose | Tool Calling | Best For |
|---|---|---|---|---|
| Kirim-V1-base | 13B | Foundation | ❌ | Research, fine-tuning |
| Kirim-V1-7B-Chat | 7B | Conversation | ❌ | Production chatbots |
| Kirim-1-Math | 16B | Mathematics | ✅ | Math problems, STEM education |
| Kirim-V2 (coming) | 30B+ | Multimodal | ✅ | Visual reasoning |
@misc{kirim2025math,
title={Kirim-1-Math: Advanced Mathematical Reasoning with Tool Calling},
author={Kirim AI Research Team},
year={2025},
publisher={Kirim AI},
url={https://huggingface.co/Kirim-ai/Kirim-1-Math}
}
We welcome contributions!
Apache License 2.0 - See LICENSE for details.