Downloads · 30 days
0
marceliooo/rpg-combat-llama-3.2-3b
rpg-combat-llama-3.2-3b is a machine learning model from marceliooo. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
A LoRA-tuned Llama-3.2-3B that referees tabletop-style melee combat: narrating the action in prose while emitting a machine-readable JSON state update after every turn.
Downloads · 30 days
0
Access
Public
Updated Sep 24, 2026
Repo size
212 MB
Likes
0
Public
Click a slice to open those files.
.safetensors97.3 MB · 85%
From the Hugging Face model README
A LoRA-tuned Llama-3.2-3B that referees tabletop-style melee combat: narrating the action in prose while emitting a machine-readable JSON state update after every turn.
Disclaimer: This is a personal learning project and hobbyist experiment — not intended for production use. It exists to document a zero-cost journey through open-weight LLM fine-tuning.
| Base model | Llama-3.2-3B-Instruct (4-bit QLoRA, via Unsloth) |
| Hardware | Free Google Colab (Tesla T4, 15 GB VRAM) |
| Framework | Unsloth + TRL / Hugging Face Transformers |
| Training | 3 epochs · ~66 steps · ~4 minutes |
| Loss | 3.11 → 1.08 |
Fine-tuned on 175 deduplicated, synthetically generated combat encounters spanning a range of fantasy archetypes (rogues, duelists, sellswords, spearmen) against a range of opponents (goblins, orcs, skeletal knights).
To stay within a zero-cost budget while avoiding public API rate limits, the dataset was built with a hybrid synthetic pipeline:
nvidia/nemotron-3-ultra-550b-a55b:free via OpenRouter) — generated initial tactical interaction seed pairsgemini-3.8-flash) — expanded and varied scenario logs via autonomous agent generationThe two sources were merged, deduplicated, and formatted into Llama-3 ChatML conversational structure before training.
System prompt
You are a tactical RPG combat engine. Resolve actions narratively, then append an exact ```json state update block.
Example
Input:
I feint a thrust with my spear and drive the butt-end into the goblin warrior's ribs.
Output:
You feint a low thrust with your ash spear, drawing the goblin's attention to your left. As
he raises his shield to block the fake blow, you drive the butt-end into his ribs with a
sickening crunch. The little warrior doubles over in agony, gasping for breath as his crude
leather armor splits open.
```json
{
"turn": 1,
"player": {"hp": 25, "max_hp": 30, "stamina": 14, "status": "normal"},
"enemy": {"name": "Goblin Warrior", "hp": 12, "max_hp": 25, "status": "bleeding"}
}
## Inference
```python
import torch
from unsloth import FastLanguageModel
max_seq_length = 2048
load_in_4bit = True
# Load base model + LoRA adapter
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="marceliooo/rpg-combat-llama-3.2-3b",
max_seq_length=max_seq_length,
load_in_4bit=load_in_4bit,
)
FastLanguageModel.for_inference(model)
messages = [
{
"role": "system",
"content": "You are a tactical RPG combat engine. Resolve actions narratively, then append an exact ```json state update block."
},
{
"role": "user",
"content": "The bandit lunges. I roll underneath his thrust and slash at his knee."
}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt"
).to("cuda")
outputs = model.generate(input_ids=inputs, max_new_tokens=256, temperature=0.6)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Trained using Unsloth on the Google Colab free tier.