Instructions to use FrontiersMind/Lumma-0.6B-Tool with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FrontiersMind/Lumma-0.6B-Tool with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FrontiersMind/Lumma-0.6B-Tool", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("FrontiersMind/Lumma-0.6B-Tool", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FrontiersMind/Lumma-0.6B-Tool with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FrontiersMind/Lumma-0.6B-Tool" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FrontiersMind/Lumma-0.6B-Tool", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FrontiersMind/Lumma-0.6B-Tool
- SGLang
How to use FrontiersMind/Lumma-0.6B-Tool with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "FrontiersMind/Lumma-0.6B-Tool" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FrontiersMind/Lumma-0.6B-Tool", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "FrontiersMind/Lumma-0.6B-Tool" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FrontiersMind/Lumma-0.6B-Tool", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FrontiersMind/Lumma-0.6B-Tool with Docker Model Runner:
docker model run hf.co/FrontiersMind/Lumma-0.6B-Tool
Lumma-0.6B-Tool
Based on Lumma-0.6B-Base, Lumma-0.6B-Tool is a lightweight, single-turn specialized model designed to accurately interpret user queries and generate precise tool calls in one step, enabling efficient and reliable function execution
The primary challenge was designing a non-thinking model that could match or exceed the tool-use performance of similarly sized thinking models, while delivering faster responses and greater efficiency.
Use cases:
- Mobile and edge devices: Enable low-latency API calls, database queries, and system integrations without relying on cloud-based reasoning.
- Real-time AI assistants: Power applications in vehicles, IoT devices, and customer support systems where fast response times are essential.
- Resource-constrained environments: Support efficient tool execution on embedded systems, battery-powered devices, and other hardware with limited compute and memory resources.
📄 Model details
List of Tools in System prompt: The system prompt must provide all the available tools, our chat template handles that.
Tool use: It consists of four main steps:
- Function definition: Pass JSON tool definitions in the system prompt via
tools_list=(inside<|im_start|><|system|>...<|endoftext|>). - Function call: Lumma returns a Pythonic call as assistant text:
[FuncName(param=value)]between<|im_start|><|assistant|>and<|endoftext|>. - Function execution: Run the call and return the result as a
toolmessage (usually JSON) between<|im_start|><|tool|>and<|endoftext|>. - Final answer: Lumma reads the tool output and replies in plain text as assistant.
🚀 Usage
import torch
import json
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_PATH = "FrontiersMind/Lumma-0.6B-Tool"
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
MODEL_PATH, trust_remote_code=True, torch_dtype=torch.bfloat16, device_map="auto"
)
model.eval()
def generate(max_new_tokens,messages):
prompt = tokenizer.apply_chat_template(
messages,
tools_list=tools_list, # pass every turn
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(
**inputs, max_new_tokens=max_new_tokens, do_sample=False,
eos_token_id=tokenizer.eos_token_id, pad_token_id=tokenizer.pad_token_id,
)
text = tokenizer.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=False)
return text.split("<|endoftext|>")[0].strip()
tools = [
{
"name": "Quotes by Keywords",
"description": "Returns a list of quotes containing the specified keyword.",
"parameters": {
"type": "dict",
"properties": {"word": {"description": "The keyword to search for in quotes.", "type": "string"}},
"required": ["word"],
},
"required": None,
},
{
"name": "Get Zip Code Information",
"description": "Retrieve information about a specific zip code in the United States.",
"parameters": {
"type": "dict",
"properties": {
"country": {"description": "The country code (default: 'us')", "type": "string"},
"postal_code": {"description": "The zip code (default: '90210')", "type": "string"},
},
"required": ["country", "postal_code"],
},
"required": None,
},
]
tools_list = json.dumps(tools)
messages = []
# --- Turn 1: user → tool call ---
messages.append({"role": "user", "content": 'Find quotes about "inspiration".'})
reply = generate(max_new_tokens=512,messages=messages)
messages.append({"role": "assistant", "content": reply})
print("Turn 1:", reply)
# --- Turn 2: tool result → answer ---
tool_call_response = """[{"name": "Quotes by Keywords", "results": {"quotes": [{"text": "Keep going.", "author": "Sam Levenson"}]}}]"""
messages.append({"role": "tool", "content": tool_call_response})
reply = generate(max_new_tokens=512,messages=messages)
messages.append({"role": "assistant", "content": reply})
print("Turn 2:", reply)
📬 Feedback & Suggestions
We’d love to hear your thoughts, feedback, and ideas!
- Discord: https://discord.gg/ZGdjCdRt
- Email: support@frontiersmind.ai
- Official Website https://www.frontiersmind.ai/
- LinkedIn: https://www.linkedin.com/company/frontiersmind/
- X (Twitter): https://x.com/FrontiersMind
- Downloads last month
- 84
Model tree for FrontiersMind/Lumma-0.6B-Tool
Base model
FrontiersMind/Lumma-0.6B-Base