Instructions to use devPirate01/SkyrimLLMBridge-Gemma-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use devPirate01/SkyrimLLMBridge-Gemma-2B with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use devPirate01/SkyrimLLMBridge-Gemma-2B 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 devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M # Run inference directly in the terminal: llama cli -hf devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M # Run inference directly in the terminal: llama cli -hf devPirate01/SkyrimLLMBridge-Gemma-2B: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 devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf devPirate01/SkyrimLLMBridge-Gemma-2B: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 devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M
Use Docker
docker model run hf.co/devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use devPirate01/SkyrimLLMBridge-Gemma-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "devPirate01/SkyrimLLMBridge-Gemma-2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "devPirate01/SkyrimLLMBridge-Gemma-2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M
- Ollama
How to use devPirate01/SkyrimLLMBridge-Gemma-2B with Ollama:
ollama run hf.co/devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M
- Unsloth Desktop
- Pi
How to use devPirate01/SkyrimLLMBridge-Gemma-2B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use devPirate01/SkyrimLLMBridge-Gemma-2B with Docker Model Runner:
docker model run hf.co/devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M
- Lemonade
How to use devPirate01/SkyrimLLMBridge-Gemma-2B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M
Run and chat with the model
lemonade run user.SkyrimLLMBridge-Gemma-2B-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use devPirate01/SkyrimLLMBridge-Gemma-2B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use devPirate01/SkyrimLLMBridge-Gemma-2B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "devPirate01/SkyrimLLMBridge-Gemma-2B:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Skyrim LLM Bridge — Fine-Tuned Gemma 2B (Q4_K_M)
This is an instruction-tuned, QLoRA fine-tuned version of Google's Gemma 2B language model, trained specifically for the Deterministic LLM Dialogue Bridge Skyrim mod as part of an MSc in Artificial Intelligence dissertation at Cardiff University.
The model is trained to output deterministic, structured JSON payloads corresponding to character persona constraints, epistemic ground truth, and quest stage transitions, solving the "unbounded hallucination" problem in LLM-driven video game NPCs.
🔬 Empirical Benchmark Results (vs Base Models)
Evaluated across 1,500 trials (5 random seeds, 100 test scenarios) on an AMD Radeon RX 6900 XT (ROCm backend):
| Metric | Base Gemma 2B | Base Command R+ (26B) | Fine-Tuned Gemma 2B (This Model) |
|---|---|---|---|
| Rule & Routing Accuracy | 19.0% (±1.76%) | 29.0% (±3.17%) | 53.4% (±3.24%) |
| Median Latency | 0.92s | 2.43s | 0.98s |
| Mean Latency | 0.95s | 2.50s | 1.91s |
| P95 Latency | 1.15s | 3.10s | 1.25s |
| Throughput (Tokens/s) | 38.5 TPS | 14.1 TPS | 36.2 TPS |
| Peak VRAM Usage | 5.5 GB | 15.6 GB | 7.1 GB |
| Epistemic Leakage Rate | 5/500 (1.0%) | 0/500 (0.0%) | 5/500 (1.0%) |
Statistical significance: Fine-tuned 2B vs Base 2B: t = 14.08, p < 0.001; Fine-tuned 2B vs Base 26B: t = 9.81, p < 0.001.
🧠 Training Context & Skyrim Interaction Dynamics
This model was adapted via QLoRA (Rank 16, Alpha 16) specifically on conversational interactions in The Elder Scrolls V: Skyrim. Rather than functioning as an unconstrained chatbot, the model was trained on thousands of multi-turn dialogues reflecting the realities of gaming environments:
- Handling Hostile & Nonsensical Prompts: Reacts with in-character clarification or de-escalation rather than breaking persona or emitting hallucinated apologies.
- Epistemic Isolation: Strictly respects what the character knows versus what remains unrevealed, preventing premature quest spoiler leaks.
- Deterministic Policy Routing: Explicitly maps narrative intent to defined game-engine policies (
witness_reveal_c1,witness_deny_map_knowledge, etc.).
📐 Trained JSON Schema Contract (For Developers & Other Games)
Developers and modders can use this exact model for other Skyrim NPCs or even other game engines (Unreal, Unity, Fallout 4, Starfield) by following this ChatML JSON specification:
1. System Prompt Template
Control <CHARACTER_NAME>. Return exactly one valid JSON object and nothing else.
PROFILE
<Character background, personality, and epistemic boundaries>
OUTPUT
Use exactly these keys in this order: schema_version, dialogue, player_intent, topic, policy_id, response_type, clue_claims, action_request.
Use double quotes. No Markdown, code fences, or extra keys. schema_version must be "1.0".
VOCAB
Intents: greet, social_chat, request_quest_guidance, offer_information, unclear, ask_for_repetition, ask_for_information, ask_for_clarification
Topics: none, witness, victim, drink, argument, unrelated, map, poison, quest_progress, suspect, personal
POLICIES
<narrative_policy_id> -> <response_type>
RULES
<Specific character knowledge and gating rules>
2. User Input Turn (Game Engine Context)
{
"schema_version": "1.0",
"request_id": "req_042",
"session": {
"session_id": "session_gameplay_01",
"experimental_group": "gameplay"
},
"quest": {
"quest_id": "poisoned_mead",
"quest_stage": 10,
"known_clues": ["C1"]
},
"npc": {
"npc_id": "tavern_witness",
"location": "The Bannered Mare"
},
"player": {
"message": "Remind me what you smelled on Vigund's cup."
}
}
3. Model Output Turn (Deterministic State Proposal)
{
"schema_version": "1.0",
"dialogue": "I handled Vigund's mead. His cup carried the bitter scent of Nightshade.",
"player_intent": "ask_for_repetition",
"topic": "drink",
"policy_id": "witness_repeat_c1",
"response_type": "repeat_known_information",
"clue_claims": ["C1"],
"action_request": null
}
Key Field Descriptions:
dialogue: The exact spoken line to be voiced or displayed by the game engine.player_intent: Semantic classification of the player's utterance (ask_for_information,threaten,greet, etc.).policy_id: The authoritative game state policy triggered by this turn.clue_claims: List of quest clues revealed during this turn (e.g.["C1"]). The external Python validator ensures the player has met prerequisites before granting the clue.action_request: Can be set to game actions (e.g.attack,flee,trade, ornull).
🛠️ How to Adapt This Model to Your Own Game / Mod
- Keep the JSON output keys identical: The model's weights are fine-tuned to emit
schema_version, dialogue, player_intent, topic, policy_id, response_type, clue_claims, action_request. - Provide your game state in the user prompt: Supply your quest ID, stage, known clues, and the player's message in the User turn.
- Validate in Python/C++: Use a lightweight validator to verify the emitted JSON before committing state changes to your game engine.
🚀 Unified Setup Guide (Part 2 of 3)
This model serves as the AI core for the Skyrim LLM Bridge.
Step 1: Get the Skyrim Mod
Download and install the game plugin via Nexus Mods.
Step 2: Run This Model in KoboldCpp
- Download
gemma-4-e2b-it.Q4_K_M.gguffrom the Files and versions tab above (~3.2 GB). - Download KoboldCpp.
- In KoboldCpp GUI:
- Model: Select
gemma-4-e2b-it.Q4_K_M.gguf - Context Size:
4096 - GPU Layers:
33(or -1 for all layers on GPUs with 8GB+ VRAM;0for CPU) - Port:
5001 - Host:
127.0.0.1
- Model: Select
- Click Launch. KoboldCpp will expose an OpenAI-compatible API at
http://127.0.0.1:5001/v1.
Step 3: Run the Python Bridge Server
- Download
SkyrimLLMBridge_Server_v1.0.zipfrom the GitHub Releases. - Extract the ZIP, install dependencies via
pip install -r requirements.txt. - In
.env, ensure:LLM_PROVIDER=koboldcpp KOBOLDCPP_URL=http://127.0.0.1:5001/v1 KOBOLDCPP_MODEL=koboldcpp SKYRIM_DATA_DIR=C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\SKSE\Plugins\StorageUtilData\CompanionLLM - Run
python bridge.pyand launch Skyrim with SKSE!
- Downloads last month
- 99
4-bit
Model tree for devPirate01/SkyrimLLMBridge-Gemma-2B
Base model
google/gemma-4-E2B