Model details:

This model is a Mixture-of-Experts (MoE) model designed to handle tasks requiring specialized knowledge in coding, mathematics, and tool usage. It is optimized for agent tasks, where the model interacts with external tools or APIs to solve complex problems by delegating sub-tasks to different expert modules.

The model is intended for scenarios where combining domain-specific reasoning (math, code) with task execution (tool or agent calls) can improve accuracy and efficiency.


Usage:

tools = [
    {
        "type": "function",
        "function": {
            "name": "parse_json",
            "description": "Parse a JSON string and return a Python object",
            "parameters": {
                "type": "object",
                "properties": {
                    "json_string": {
                        "type": "string",
                        "description": "The JSON string to parse"
                    }
                },
                "required": ["json_string"]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "calc_factorial",
            "description": "Calculate factorial of an integer n",
            "parameters": {
                "type": "object",
                "properties": {
                    "n": {"type": "integer", "description": "The number to factorialize"}
                },
                "required": ["n"]
            }
        }
    }
]

messages = [
    {"role": "system", "content": "You are a helpful assistant. You can call functions if needed."},
    {"role": "user", "content": "Who are you."},
]

# Build chat prompt with tool schema
chat_prompt = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    tools=tools,
    add_generation_prompt=True,
    enable_thinking = True
)

print("=== Prompt sau khi apply chat template ===")
print(chat_prompt)

# Check router decision
chosen_expert = model.route(messages[-1]["content"])
print(f"Router chosen: {chosen_expert}")

# Generate với expert được chọn
output_ids = model.generate(chat_prompt, max_new_tokens=1024)
print(tokenizer.decode(output_ids[0], skip_special_tokens=False))
Downloads last month
1,524
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support