Views
No views yet

| Property | Value |
|---|---|
| Parameters | 1.2B |
| Precision | 4-bit |
| Group Size | 64 |
| Size | 628 MB |
| Context Length | 32K |
| Parameter | Value |
|---|---|
| temperature | 0.1 |
| top_k | 50 |
| top_p | 0.1 |
| repetition_penalty | 1.05 |
| max_tokens | 512 |
pip install mlx-lm1from mlx_lm import load, generate
2from mlx_lm.sample_utils import make_sampler, make_logits_processors
3
4model, tokenizer = load("LiquidAI/LFM2.5-1.2B-Thinking-4bit")
5
6prompt = "solve 2+2*2"
7
8if tokenizer.chat_template is not None:
9 messages = [{"role": "user", "content": prompt}]
10 prompt = tokenizer.apply_chat_template(
11 messages, tokenize=False, add_generation_prompt=True
12 )
13
14sampler = make_sampler(temp=0.1, top_k=50, top_p=0.1)
15logits_processors = make_logits_processors(repetition_penalty=1.05)
16
17response = generate(
18 model,
19 tokenizer,
20 prompt=prompt,
21 max_tokens=512,
22 sampler=sampler,
23 logits_processors=logits_processors,
24 verbose=True,
25)<|startoftext|><|im_start|>system
{system_prompt}<|im_end|>
<|im_start|>user
{user_message}<|im_end|>
<|im_start|>assistant
{assistant_response}<|im_end|><think> tags before the final answer:<think>
[Internal reasoning process...]
</think>
[Final answer]<|startoftext|><|im_start|>user
solve 2+2*2<|im_end|>
<|im_start|>assistant<think> Okay, let me try to solve this problem: "2+2*2". Hmm, first I need to make sure I understand what exactly is being asked here. The expression is 2 + 2*2. Alright, so maybe it's just a simple arithmetic problem. Let me break it down step by step.
First, looking at the expression 2 + 2*2. I know in math, the order of operations is important here. Multiplication comes before addition, right? So the 2*2 would be calculated first. So 2 times 2 is 4. Then add that to the initial 2. So 2 + 4 equals 6.
</think>
The answer is **6**.
Following the order of operations (PEMDAS/BODMAS), multiplication is performed before addition:
- First: 2 × 2 = 4
- Then: 2 + 4 = 6<think> content from previous assistant messages in multi-turn conversations. To preserve thinking in history, use:1prompt = tokenizer.apply_chat_template(
2 messages,
3 tokenize=False,
4 add_generation_prompt=True,
5 keep_past_thinking=True # Preserve thinking in history
6)List of tools: [{"name": "tool_name", "description": "...", "parameters": {...}}]<|tool_call_start|>[function_name(arg1="value1", arg2="value2")]<|tool_call_end|>tool role message:<|im_start|>tool
[{"result": "..."}]<|im_end|>