Instructions to use itslenoid/llama3.2-3b-ninjutsu-peft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use itslenoid/llama3.2-3b-ninjutsu-peft with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-3B-Instruct") model = PeftModel.from_pretrained(base_model, "itslenoid/llama3.2-3b-ninjutsu-peft") - Notebooks
- Google Colab
- Kaggle
π₯· LoRA Adapter (PyTorch PEFT) β Llama 3.2 3B Instruct (Ninjutsu Coaching)
A standard PyTorch PEFT low-rank adapter (LoRA) fine-tuned on Llama-3.2-3B-Instruct. Specialized for direct, actionable coaching in skill acquisition, distilled from the principles in Modern Applications of Ninjutsu.
π Model Selection: Which Version Should You Use?
| Model Version | Repository | Format | Best For |
|---|---|---|---|
| π¦ PyTorch PEFT Adapter (This Repo) | itslenoid/llama3.2-3b-ninjutsu-peft | PEFT / PyTorch (~27.8 MB) | Linux / CUDA / Cloud. Standard Hugging Face Transformers & PEFT workflows. |
| β‘ Standalone Fused (Apple Silicon) | itslenoid/llama3.2-3b-ninjutsu-fused | MLX 4-bit (~1.8 GB) | Mac (M1/M2/M3/M4). Instant 1-click standalone model on Apple Silicon using mlx-lm. |
| π¦ MLX LoRA Adapter | itslenoid/llama3.2-3b-ninjutsu | MLX (~27.8 MB) | Mac (Apple Silicon). Native MLX adapter for mlx-community/Llama-3.2-3B-Instruct-4bit. |
| π Interactive Web Demo | itslenoid/llama3.2-3b-ninjutsu-demo | Gradio / ZeroGPU | Web Browser. Try the model instantly without any local setup. |
π― What This Model Does
Standard language models often respond to skill and coaching questions with generic advice, disclaimers, and conversational filler. This fine-tune acts as a deliberate practice coach:
- Direct & Actionable: Tells you what physical or mental adjustments to execute, step-by-step.
- Progressive Pedagogy: Scaffolds complex movements or skills into digestible sub-skills and constraints.
- Root-Cause Diagnostics: Identifies mechanical and perceptual errors rather than merely repeating basic form tips.
- Zero Hedging: Authoritative, concise tone focused on performance feedback and deliberate repetition.
π‘ Recommended Coaching Prompts
- "Break down a 15-minute deliberate practice session for developing hip drive in rotational strikes."
- "I keep losing balance during rapid direction changes on uneven ground. Diagnose my mechanical error."
- "Design a 3-stage progressive overload constraint drill for handling high-pressure sparring."
- "How do I structure skill acquisition for a completely new motor pattern without ingraining bad habits?"
π Quick Start (PyTorch / Transformers / PEFT)
1. Installation
pip install torch transformers peft accelerate
2. Python Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_id = "meta-llama/Llama-3.2-3B-Instruct"
adapter_id = "itslenoid/llama3.2-3b-ninjutsu-peft"
# 1. Load tokenizer and base model
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
# 2. Attach Ninjutsu Coaching PEFT adapter
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()
# 3. Format prompt using chat template
messages = [
{"role": "system", "content": "You are an expert martial arts and skill acquisition coach. Provide direct, actionable, and structured guidance without conversational hedging or filler."},
{"role": "user", "content": "How do I learn a new technique efficiently?"}
]
input_ids = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
# 4. Generate
with torch.no_grad():
outputs = model.generate(
input_ids,
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
)
response = tokenizer.decode(outputs[0][input_ids.shape[1]:], skip_special_tokens=True)
print(response)
π Training & Technical Details
| Parameter | Value |
|---|---|
| Base Architecture | Llama 3.2 3B Instruct |
| Base Model Weights | meta-llama/Llama-3.2-3B-Instruct |
| Adapter Type | LoRA (PEFT) |
| LoRA Rank | 8 |
| LoRA Scale | 20.0 |
| Tuned Layers | 16 / 28 (layers 12 through 27) |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Dropout | 0.0 |
| Best Validation Loss | 2.540 |
| Perplexity (PPL) | 19.05 β 12.68 (~33% relative improvement) |
π₯
Defensive Training & Evaluation with llm-goalie
This model was trained, tuned, and evaluated using llm-goalie, an open-source defensive fine-tuning and evaluation engine for Apple Silicon.
llm-goalie ran automated hyperparameter tournament sweeps with active early stopping to prevent overfitting, rigorously triangulating model quality against held-out perplexity (improving from 19.05 β 12.68), catastrophic forgetting benchmarks, and strict rule-based control gates. To reproduce these results or fine-tune your own domain models locally, visit the project-kingmaker/llm-goalie repository.
π About the Project & Source Material
This adapter distills pedagogical principles from Modern Applications of Ninjutsu, a treatise on progressive skill acquisition, motor learning, constraint-led training, and martial arts pedagogy.
The training dataset transforms the book's frameworks on deliberate practice, neuromuscular adaptation, and physical discipline into instruction-following weights, producing an assistant capable of diagnosing mechanical breakdowns and prescribing structured drills.
- Source Material: ninjainbrazil.com/book
- Live Interactive Demo: Hugging Face Space
- Training Engine: project-kingmaker/llm-goalie
- Standalone Fused Model: itslenoid/llama3.2-3b-ninjutsu-fused
- MLX LoRA Adapter: itslenoid/llama3.2-3b-ninjutsu
π License
This adapter inherits the Meta Llama 3.2 Community License from the base model.
- Downloads last month
- 57
Model tree for itslenoid/llama3.2-3b-ninjutsu-peft
Base model
meta-llama/Llama-3.2-3B-Instruct