Instructions to use Moonlink/Mable-0.5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Moonlink/Mable-0.5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Moonlink/Mable-0.5") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Moonlink/Mable-0.5") model = AutoModelForCausalLM.from_pretrained("Moonlink/Mable-0.5", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use Moonlink/Mable-0.5 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Moonlink/Mable-0.5", filename="gemma-2-2b-it.Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Moonlink/Mable-0.5 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Moonlink/Mable-0.5:Q4_K_M # Run inference directly in the terminal: llama cli -hf Moonlink/Mable-0.5:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Moonlink/Mable-0.5:Q4_K_M # Run inference directly in the terminal: llama cli -hf Moonlink/Mable-0.5:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Moonlink/Mable-0.5:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Moonlink/Mable-0.5:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Moonlink/Mable-0.5:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Moonlink/Mable-0.5:Q4_K_M
Use Docker
docker model run hf.co/Moonlink/Mable-0.5:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Moonlink/Mable-0.5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Moonlink/Mable-0.5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Moonlink/Mable-0.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Moonlink/Mable-0.5:Q4_K_M
- SGLang
How to use Moonlink/Mable-0.5 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 "Moonlink/Mable-0.5" \ --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": "Moonlink/Mable-0.5", "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 "Moonlink/Mable-0.5" \ --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": "Moonlink/Mable-0.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Moonlink/Mable-0.5 with Ollama:
ollama run hf.co/Moonlink/Mable-0.5:Q4_K_M
- Unsloth Studio
How to use Moonlink/Mable-0.5 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Moonlink/Mable-0.5 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Moonlink/Mable-0.5 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Moonlink/Mable-0.5 to start chatting
- Atomic Chat new
- Docker Model Runner
How to use Moonlink/Mable-0.5 with Docker Model Runner:
docker model run hf.co/Moonlink/Mable-0.5:Q4_K_M
- Lemonade
How to use Moonlink/Mable-0.5 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Moonlink/Mable-0.5:Q4_K_M
Run and chat with the model
lemonade run user.Mable-0.5-Q4_K_M
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)
Mable-0.5 ๐ง โก
A high-reasoning 2B language model fine-tuned on Gemma-2-2B using Fable-5 reasoning traces.
๐ Model Overview
Mable-0.5 is a fine-tuned variant of Google's Gemma-2-2B-it, trained with 3,500 curated reasoning traces from the Fable-5 dataset. It specializes in step-by-step reasoning, structured chain-of-thought (CoT) breakdown, and execution-oriented decision making.
- Developer: Moonlink
- Base Model:
unsloth/gemma-2-2b-it-bnb-4bit - Fine-Tuning Technique: LoRA (Rank = 16, Alpha = 32)
- Optimization: Fine-tuned via Unsloth
๐ Available Formats & Usage
This repository contains all 3 formats for maximum flexibility across deployment environments:
1. ๐ฆ GGUF Format (Local / Ollama / LM Studio)
Run Mable-0.5 locally on CPU or Apple Silicon using the quantized .gguf file.
Using Ollama:
# Download and run the quantized GGUF directly from Hugging Face
ollama run hf.co/Moonlink/Mable-0.5:Q4_K_M
2. โก LoRA Adapters (Transformers / Unsloth)
Attach the lightweight adapter weights to the base Gemma-2-2B model.
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "Moonlink/Mable-0.5",
max_seq_length = 2048,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
prompt = """<start_of_turn>user
How many r's are in the word strawberry?<end_of_turn>
<start_of_turn>model
THOUGHT:
"""
inputs = tokenizer([prompt], return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
3. ๐ฆ Merged 16-Bit Weights (vLLM / Pipeline Deployment)
Use the fully merged standalone model for production serving.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Moonlink/Mable-0.5"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto"
)
๐ Prompt Format
Mable-0.5 follows the Gemma chat template with explicit THOUGHT: and ACTION: structural blocks:
<start_of_turn>user
{Your prompt here}<end_of_turn>
<start_of_turn>model
THOUGHT:
{Chain-of-thought reasoning steps}
ACTION:
{Final response or action}
<end_of_turn>
๐ ๏ธ Fine-Tuning Hyperparameters
- Max Sequence Length: 2,048 tokens
- Optimizer: AdamW 8-bit
- Learning Rate: 2e-4 (Linear decay)
- Effective Batch Size: 4 (Batch size = 1, Gradient Accumulation = 4)
- Epochs/Steps: 120 steps (~3,500 rows processed)
- Precision: Mixed FP16/BF16
๐ค If you benefit from any of our work in HuggingFace please give us a Like or Follow.
- Downloads last month
- 79
Model tree for Moonlink/Mable-0.5
Base model
unsloth/gemma-2-2b-it-bnb-4bit
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Moonlink/Mable-0.5", filename="gemma-2-2b-it.Q4_K_M.gguf", )