惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
小众软件
小众软件
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
V
Visual Studio Blog
C
Check Point Blog
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
量子位
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
M
MIT News - Artificial intelligence
爱范儿
爱范儿
B
Blog RSS Feed
MyScale Blog
MyScale Blog
H
Help Net Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
美团技术团队
L
LangChain Blog
D
Docker

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Insults & Cutlasses, Local LLM Sword Fighting on Melee Is...
raslanove · 2026-05-25 · via DEV Community

raslanove

Gemma 4 Challenge: Build With Gemma 4 Submission

This is a submission for the Gemma 4 Challenge: Build with Gemma 4

What I Built

Insults & Cutlasses is a terminal-based insult sword fighting game inspired by The Secret of Monkey Island.

The player enters a world where victory is not achieved through brute force, but through witty insults, structured comebacks, and AI-judged verbal duels.

Each battle follows a strict loop:

  • The opponent generates an insult
  • The player responds with a comeback
  • A judge evaluates whether the response is strong or weak
  • Points are awarded accordingly
  • First to 3 points wins the duel

After each victory or defeat, a new pirate opponent appears and the journey continues toward the Swordmaster of Melee Island.

This project explores how local LLMs can power structured gameplay systems, turning natural language into a competitive game mechanic rather than a free-form chatbot.

Demo

Code

GitHub repository:
https://github.com/raslanove/InsultsAndCutlasses

How I Used Gemma 4

This project is powered by Gemma 4 E2B IT (quantized GGUF version).

I chose the E2B model because:

  • It has a small enough memory footprint to run locally without a GPU
  • It performs well on CPU-only environments (even consumer laptops)
  • It maintains strong instruction-following behavior compared to other small models
  • It is ideal for embedding into real-time interactive applications like games

Why Gemma 4 was essential

Earlier small models struggled with:

  • Consistent roleplay behavior
  • Structured output formats
  • Maintaining "pirate duel logic" across turns

Gemma 4 significantly improved:

  • Instruction adherence for strict insult/reply/judge formatting
  • Stability in multi-turn interactions
  • Creativity in generating themed pirate insults and comebacks

Fine-tuning (LoRA)

To make the model behave like a true Monkey Island-style insult duel system, I trained a LoRA adapter using a custom dataset:

  • MonkeyIslandStylePirateDuelDataset.jsonl

The dataset teaches the model:

Insult → Reply → Judge

Training was done entirely on CPU:

  • AMD Ryzen 5 PRO 4650G
  • 32GB RAM

The LoRA was trained in:

  • InsultsAndCutlasses.ipynb

This allows the base model to consistently:

  • Generate insults
  • Respond in character
  • Evaluate responses fairly