YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
π€ Gemma-3-270M Fine-Tuned on OpenThoughts-114k
A compact, reasoning-capable assistant trained on 114K high-quality synthetic examples covering math, science, code, and logic puzzles.
π Overview
This model is a LoRA fine-tuned version of gemma-3-270m-it, trained on the OpenThoughts-114k dataset β a high-quality synthetic reasoning dataset with 114,000 examples spanning math, coding, science, and puzzles.
β
Trained with Unsloth for 2Γ faster training & 60% less VRAM
β
Supports local inference via GGUF (Q8_0, BF16) and continued training via LoRA
β
Ideal for local LLM enthusiasts, developers, and researchers needing a small but smart model
π Model Details
| Attribute | Value |
|---|---|
| Base Model | unsloth/gemma-3-270m-it |
| Dataset | open-thoughts/OpenThoughts-114k |
| Training Method | LoRA (rank=64) + Unsloth-optimized SFT |
| Context Length | 2048 tokens |
| Hardware Used | Google Colab T4 (16GB VRAM) |
| Training Steps | 300 steps (~30 minutes) |
| Final Loss | ~2.81 |
| Trainable Params | 15.2M (5.36% of total) |
| License | LGPL-3.0 |
π The dataset uses a structured "Thought β Solution" format, teaching the model to reason step-by-step before answering β ideal for complex tasks.
π Quick Start
βΆοΈ Run with Ollama
# Create Modelfile
echo 'FROM ./gemma-3-270m-openthoughts.Q8_0.gguf
TEMPLATE "{{ if .Prompt }}<start_of_turn>user\n{{ .Prompt }}<end_of_turn>\n<start_of_turn>model\n{{ end }}"
PARAMETER temperature 0.8
PARAMETER top_p 0.95
PARAMETER top_k 64' > Modelfile
# Build and run
ollama create my-gemma -f Modelfile
ollama run my-gemma
βΆοΈ Use with llama.cpp
./main -m gemma-3-270m-openthoughts.Q8_0.gguf -p "Explain backpropagation like I'm 12." -n 150
βΆοΈ Load in Python (Transformers + Unsloth)
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained("your-hf-username/gemma-3-270m-openthoughts")
# Use for inference or continued training
π₯ Download Files
| File | Format | Use Case |
|---|---|---|
gemma-3-270m-openthoughts.Q8_0.gguf |
8-bit quantized | Best for llama.cpp, Ollama, LM Studio |
gemma-3-270m-openthoughts.BF16.gguf |
Full precision | Highest quality, larger size |
adapter_model.safetensors |
LoRA adapter | For continued training or merging |
π‘ Recommendation: Use
Q8_0for most local applications (~500 MB). UseBF16only if you need maximum fidelity.
π Continue Training
You can resume training on new datasets (e.g., teknium/OpenHermes-2.5) using the LoRA checkpoint:
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name = "your-hf-username/gemma-3-270m-openthoughts", # LoRA folder
max_seq_length = 2048,
load_in_4bit = True,
)
# Add new data and train!
π§ Why OpenThoughts?
- β 114K diverse reasoning examples
- β Verified correctness (solutions validated during generation)
- β Covers math, algorithms, physics, logic puzzles
- β Structured chain-of-thought format improves reasoning
- β Fully open-source (paper, code, data available)
π Read the OpenThoughts paper for full methodology.
π οΈ Training Code (Unsloth)
Trained in <30 minutes on a free T4 using:
from unsloth import FastModel
from datasets import load_dataset
# Load model
model, tokenizer = FastModel.from_pretrained(
"unsloth/gemma-3-270m-it",
load_in_4bit=True,
max_seq_length=2048,
)
# Apply LoRA
model = FastModel.get_peft_model(model, r=64)
# Load & format OpenThoughts
dataset = load_dataset("open-thoughts/OpenThoughts-114k", split="train[:50000]")
# (system + conversations β user/assistant only for Gemma-3)
# Train
trainer = SFTTrainer(..., max_steps=300, per_device_train_batch_size=4)
trainer.train()
# Export to GGUF
model.save_pretrained_gguf("gemma-3-270m-openthoughts", tokenizer, quantization_method="Q8_0")
π License
- Model: LGPL-3.0 (Unsloth License)
- Base Gemma-3: Google Gemma Terms
- Dataset: OpenThoughts License
β οΈ Commercial use: Review Gemmaβs terms before deployment.
π Acknowledgements
- Unsloth β for blazing-fast, memory-efficient fine-tuning
- OpenThoughts Team β for the high-quality reasoning dataset
- Hugging Face β for the ecosystem and tools
- Downloads last month
- 28
8-bit
16-bit