Instructions to use blightwidow/ps2-decomp-assist-gemma4-e2b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use blightwidow/ps2-decomp-assist-gemma4-e2b-lora with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("blightwidow/ps2-decomp-assist-gemma4-e2b-lora") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use blightwidow/ps2-decomp-assist-gemma4-e2b-lora 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 blightwidow/ps2-decomp-assist-gemma4-e2b-lora:Q8_0 # Run inference directly in the terminal: llama cli -hf blightwidow/ps2-decomp-assist-gemma4-e2b-lora:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf blightwidow/ps2-decomp-assist-gemma4-e2b-lora:Q8_0 # Run inference directly in the terminal: llama cli -hf blightwidow/ps2-decomp-assist-gemma4-e2b-lora:Q8_0
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf blightwidow/ps2-decomp-assist-gemma4-e2b-lora:Q8_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf blightwidow/ps2-decomp-assist-gemma4-e2b-lora:Q8_0
Use Docker
docker model run hf.co/blightwidow/ps2-decomp-assist-gemma4-e2b-lora:Q8_0
- Llama new
- LM Studio
- Jan
- vLLM
How to use blightwidow/ps2-decomp-assist-gemma4-e2b-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "blightwidow/ps2-decomp-assist-gemma4-e2b-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "blightwidow/ps2-decomp-assist-gemma4-e2b-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/blightwidow/ps2-decomp-assist-gemma4-e2b-lora:Q8_0
- Ollama
How to use blightwidow/ps2-decomp-assist-gemma4-e2b-lora with Ollama:
ollama run hf.co/blightwidow/ps2-decomp-assist-gemma4-e2b-lora:Q8_0
- Unsloth Desktop
- Pi
How to use blightwidow/ps2-decomp-assist-gemma4-e2b-lora with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "blightwidow/ps2-decomp-assist-gemma4-e2b-lora"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "blightwidow/ps2-decomp-assist-gemma4-e2b-lora" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use blightwidow/ps2-decomp-assist-gemma4-e2b-lora with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "blightwidow/ps2-decomp-assist-gemma4-e2b-lora"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "blightwidow/ps2-decomp-assist-gemma4-e2b-lora" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "blightwidow/ps2-decomp-assist-gemma4-e2b-lora", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use blightwidow/ps2-decomp-assist-gemma4-e2b-lora with Docker Model Runner:
docker model run hf.co/blightwidow/ps2-decomp-assist-gemma4-e2b-lora:Q8_0
- Lemonade
How to use blightwidow/ps2-decomp-assist-gemma4-e2b-lora with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull blightwidow/ps2-decomp-assist-gemma4-e2b-lora:Q8_0
Run and chat with the model
lemonade run user.ps2-decomp-assist-gemma4-e2b-lora-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use blightwidow/ps2-decomp-assist-gemma4-e2b-lora with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "blightwidow/ps2-decomp-assist-gemma4-e2b-lora"
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 blightwidow/ps2-decomp-assist-gemma4-e2b-lora
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use blightwidow/ps2-decomp-assist-gemma4-e2b-lora with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "blightwidow/ps2-decomp-assist-gemma4-e2b-lora"
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 "blightwidow/ps2-decomp-assist-gemma4-e2b-lora" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
ps2-decomp-assist (Gemma 4 E2B, LoRA)
Two LoRA adapters (rank 32) for mlx-community/gemma-4-e2b-it-bf16 that turn MIPS R5900 (PS2 EE) assembly into C++ for small functions (at most 400 bytes). Used by the ps2-decomp-assist CLI, which verifies every candidate with the decompilation project's own compiler and comparer. Raw model output is a proposal, not a match.
| Folder | Task | Prompt | Output |
|---|---|---|---|
t1/ |
translate | game, function id, size, declarations context, assembly | the function |
repair/ |
repair | the same prompt plus a failed CANDIDATE: and its DIFF: (instruction diff or compiler error) |
the corrected function |
repair/ continues from t1/; it was trained on a mix of repair and translation examples.
gguf/ holds the same two models fused into the bf16 base and exported for llama.cpp (Q8_0, 4.9 GB each): gguf/ps2-decomp-assist-t1-Q8_0.gguf and gguf/ps2-decomp-assist-repair-Q8_0.gguf. On 150 validation functions the T1 Q8_0 export scores 28.7% EXACT@8 (MLX adapter: 29.3%, inside the noise). Q4_K_M lost about 8 points and is not published. Serve with llama-server --jinja --chat-template-kwargs '{"enable_thinking": false}'; commands and results in the repository's docs/GGUF.md.
Use
git clone https://github.com/Blightwidow/ps2-decomp-assist && cd ps2-decomp-assist
scripts/decomp-assist --game sly2 --function func_XXXXXXXX
The CLI downloads these adapters on first run. Without the CLI: mlx_lm.generate --model mlx-community/gemma-4-e2b-it-bf16 --adapter-path <folder> with the chat template, thinking off. Prompt formats are in the repository (pipeline/token_stats.py, pipeline/repair_data.py).
Training
LoRA on all attention and MLP projections, mask-prompt (loss on the function only), bf16, 2,048-token sequences. t1/: all rule-clean training functions of the two games (5,503 examples), about 3 epochs in one run that was resumed once after an interruption. repair/: 4,768 repair examples (3,170 mined model failures, 2,239 synthetic mutations of correct code) plus 2,500 translation examples. Validation loss 0.181 (t1/) and 0.131 on the mixed set (repair/).
Trained and evaluated only on Sly Cooper and the Thievius Raccoonus and Sly 2 (NTSC-U), compiled with SN GCC 2.95.3. Other games and compilers are untested.
Evaluation
150 held-out validation functions, 8 samples each, exact byte match plus rule-clean:
| EXACT@1 | EXACT@4 | EXACT@8 | Compiles@1 | |
|---|---|---|---|---|
t1/ |
19.8% | 26.0% | 29.3% | 68.7% |
repair/ as a translator |
21.5% | 27.0% | 30.0% | 66.7% |
t1/ then one repair/ round on its failures |
โ | โ | 36.0% | โ |
By size (EXACT@8): up to 100 B 48.6%, up to 200 B 19.1%, up to 400 B 3.0%. Noise on 150 functions is about 3 points. On a 20-function sample zero-shot Claude Haiku matched 55% against 40% for t1/. Full results: the repository's docs/EVAL.md.
Limits
- Weak above 200 bytes; about a third of candidates do not compile.
- The model memorises the functions it trained on; scores on training functions are not a measure of skill.
- Needs the game project's verifier for any claim of a match, and the project's full build before a commit.
- Output derives from the disc image you supply. Keep it local and follow the game project's rules on posting generated material.
Data
The adapters are trained on pairs of assembly generated from discs the authors own and the authors' own decompiled source. No disc data, assembly or dataset is distributed here.
Unofficial fan tooling. Not affiliated with Sony Interactive Entertainment, Sucker Punch Productions or Google.
- Downloads last month
- 238
Model tree for blightwidow/ps2-decomp-assist-gemma4-e2b-lora
Base model
google/gemma-4-E2B