Lumees-3.8B-Reasoning

Lumees is a specialized reasoning model distilled from Phi-3 Mini. It features an internal "Thinking Process" enabled by the <|thought|> token, allowing it to break down complex logic before answering.

Architecture

This model uses a custom architecture (LumeesForCausalLM) derived from Phi-3, optimized for structural reasoning chains.

How to Use

You must use trust_remote_code=True to load this model.

from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
import torch

# Path to your locally merged model
model_id = "lumees/Lumees-3.8B-Reasoning"

print(f"--- Loading {model_id} ---")
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_id, 
    trust_remote_code=True, 
    device_map="auto",
    torch_dtype=torch.bfloat16
)

# 1. The Question
messages = [{"role": "user", "content": "What is 25*25-15?"}]

# 2. Apply Template (Standard)
input_ids = tokenizer.apply_chat_template(
    messages, 
    add_generation_prompt=True, 
    return_tensors="pt"
).to(model.device)

# 3.Force the Thinking Token
# We append the <|thought|> token ID (32002) to the end of the prompt.
# This leaves the model no choice but to start generating inside the thought block.
thought_token_id = tokenizer.convert_tokens_to_ids("<|thought|>")

# Safety check to ensure the token exists
if thought_token_id is None:
    print("Warning: <|thought|> token not found. Using raw ID 32002.")
    thought_token_id = 32002

input_ids = torch.cat([
    input_ids, 
    torch.tensor([[thought_token_id]], device=model.device)
], dim=1)

print("\n--- Lumees Reasoning ---")
# 4. Stream the Output
# We use TextStreamer so you can watch it think in real-time
streamer = TextStreamer(tokenizer, skip_prompt=True)

outputs = model.generate(
    input_ids, 
    max_new_tokens=1024, 
    temperature=0.6,      # Lower temperature is better for logic
    top_p=0.9,
    pad_token_id=tokenizer.eos_token_id,
    streamer=streamer
)

Prompt: "Solve this: 25 * 25 - 15"

Inference Result (Lumees Output):

<|user|> Solve this: 25 * 25 - 15<|end|>
<|assistant|> <|thought|>
Okay, let's see. The problem is 25 multiplied by 25, then subtract 15. Hmm, let me break it down step by step.

First, I need to do the multiplication part. So, 25 times 25. I remember that 25 squared is 625. So 25 * 25 is 625.

Now, the next step is to subtract 15 from that result. So 625 minus 15. Let me do that subtraction. 625 minus 15. Let's subtract the units first. 5 minus 5 is 0. Then 2 minus 1 is 1. The hundreds place: 6 minus nothing is 6. So the result is 610.

Wait, let me double-check that. 625 minus 15. Yes, 5 minus 5 is 0, 2 minus 1 is 1, 6 minus nothing is 6. So 610. That seems right.
</|thought|>
Therefore, the final answer is 610.<|end|><|endoftext|>
Downloads last month
66
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for lumees/Lumees-3.8B-Reasoning

Finetuned
(412)
this model

Collection including lumees/Lumees-3.8B-Reasoning