Instructions to use arnavm7/candy-crush-qwen35-grpo-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use arnavm7/candy-crush-qwen35-grpo-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-9B") model = PeftModel.from_pretrained(base_model, "arnavm7/candy-crush-qwen35-grpo-lora") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use arnavm7/candy-crush-qwen35-grpo-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 arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M # Run inference directly in the terminal: llama cli -hf arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M # Run inference directly in the terminal: llama cli -hf arnavm7/candy-crush-qwen35-grpo-lora: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 arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf arnavm7/candy-crush-qwen35-grpo-lora: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 arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M
Use Docker
docker model run hf.co/arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use arnavm7/candy-crush-qwen35-grpo-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "arnavm7/candy-crush-qwen35-grpo-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": "arnavm7/candy-crush-qwen35-grpo-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M
- Ollama
How to use arnavm7/candy-crush-qwen35-grpo-lora with Ollama:
ollama run hf.co/arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M
- Unsloth Studio
How to use arnavm7/candy-crush-qwen35-grpo-lora with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for arnavm7/candy-crush-qwen35-grpo-lora to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for arnavm7/candy-crush-qwen35-grpo-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for arnavm7/candy-crush-qwen35-grpo-lora to start chatting
- Pi
How to use arnavm7/candy-crush-qwen35-grpo-lora with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use arnavm7/candy-crush-qwen35-grpo-lora with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf arnavm7/candy-crush-qwen35-grpo-lora: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 arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use arnavm7/candy-crush-qwen35-grpo-lora with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf arnavm7/candy-crush-qwen35-grpo-lora: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 "arnavm7/candy-crush-qwen35-grpo-lora: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"
- Docker Model Runner
How to use arnavm7/candy-crush-qwen35-grpo-lora with Docker Model Runner:
docker model run hf.co/arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M
- Lemonade
How to use arnavm7/candy-crush-qwen35-grpo-lora with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull arnavm7/candy-crush-qwen35-grpo-lora:Q4_K_M
Run and chat with the model
lemonade run user.candy-crush-qwen35-grpo-lora-Q4_K_M
List all available models
lemonade list
Candy Crush Qwen3.5 GRPO LoRA
This repository contains a LoRA adapter trained with GRPO for Candy Crush-style swap recommendation.
The model receives an 8x8 board state as text and returns a text swap command:
swap (r,c) (r,c)
Model
- Base model:
Qwen/Qwen3.5-9B - Adapter:
arnavm7/candy-crush-qwen35-grpo-lora - Precision used for inference: 4-bit QLoRA on CUDA
- Merged GGUF:
gguf/candy-crush-qwen35-grpo-Q4_K_M.gguf
Standalone Code
Runnable standalone code is included in the standalone/ folder of this model repository.
git clone https://huggingface.co/arnavm7/candy-crush-qwen35-grpo-lora
cd candy-crush-qwen35-grpo-lora/standalone
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements.txt
PYTHONPATH=src python -m candy_grpo.recommend --json
You can also use the package from another checkout:
PYTHONPATH=src python -m candy_grpo.recommend \
--adapter-id arnavm7/candy-crush-qwen35-grpo-lora \
--base-model Qwen/Qwen3.5-9B \
--seed 4242 \
--special-seed 5252
Board Encoding
- Normal candies are colors
0..5. 3Hmeans color 3 horizontal striped.3Vmeans color 3 vertical striped.3Wmeans color 3 wrapped.B*means black/color-bomb.
The prompt lists legal swaps and immediate simulated rewards. If generated text cannot be parsed into a legal move, the provided production agent falls back to the best immediate legal action.
Q4_K_M GGUF
For efficient Mac and CPU inference, use the merged Q4_K_M GGUF instead of the Transformers/PEFT adapter path:
gguf/candy-crush-qwen35-grpo-Q4_K_M.gguf
Artifact details:
| Field | Value |
|---|---|
| Quantization | Q4_K_M |
| Size | 5.3 GB |
| SHA256 | 96b9c951c8f76a9b8b18f8c593871ee6c270e05adac6eb2fd10a1bd3c37b90cc |
| Runtime | llama.cpp |
Download:
pip install -U huggingface_hub
huggingface-cli download arnavm7/candy-crush-qwen35-grpo-lora \
gguf/candy-crush-qwen35-grpo-Q4_K_M.gguf \
gguf/candy-crush-qwen35-grpo-Q4_K_M.gguf.sha256 \
--local-dir .
cd gguf
sha256sum -c candy-crush-qwen35-grpo-Q4_K_M.gguf.sha256
Run with a recent llama.cpp build:
llama-completion \
-m gguf/candy-crush-qwen35-grpo-Q4_K_M.gguf \
-c 4096 \
-t 8 \
-n 24 \
--temp 0 \
--no-display-prompt \
--no-conversation \
--single-turn \
--simple-io \
-p "Task: choose one legal Candy Crush swap.
Required first-line format:
swap (r,c) (r,c)
Board:
0 1 2 3 4 5 0 1
1 2 3 4 5 0 1 2
2 3 4 5 0 1 2 3
3 4 5 0 1 2 3 4
4 5 0 1 2 3 4 5
5 0 1 2 3 4 5 0
0 1 2 3 4 5 0 1
1 2 3 4 5 0 1 2
Answer now. First line only the swap command:"
For best quality, use the full board prompt generated by the app, including special candy rules and valid actions.
Run In The GUI
The GUI is part of the main Candy Crush app, while this Hugging Face repo stores the LoRA adapter and standalone inference package. To test the model in the GUI, clone the app branch, download the adapter into the GUI's expected local folder, then run the llm_grpo agent.
git clone -b llm-grpo-qwen-candy https://github.com/vaibhavdabas16/candy-crush.git
cd candy-crush
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements.txt
pip install -U transformers peft accelerate bitsandbytes huggingface_hub
python - <<'PY'
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="arnavm7/candy-crush-qwen35-grpo-lora",
local_dir="models/llm_grpo_candy/qwen35_9b/final_plus30",
ignore_patterns=["standalone/*"],
)
PY
python run_gui.py \
--agent llm_grpo \
--llm-grpo-path models/llm_grpo_candy/qwen35_9b/final_plus30 \
--llm-model-name Qwen/Qwen3.5-9B \
--agent-delay 0.8
The GUI path uses the same production inference flow as the standalone package: serialize the current board to text, generate a swap with Qwen plus this LoRA adapter, parse swap (r,c) (r,c), validate it against CandyEnv, and fall back to the best immediate legal swap if parsing fails.
If you are on a headless server, this command can verify startup but will not display a visible window:
SDL_VIDEODRIVER=dummy timeout 30 python run_gui.py \
--agent llm_grpo \
--llm-grpo-path models/llm_grpo_candy/qwen35_9b/final_plus30
MacBook / CPU Inference
The adapter targets Qwen/Qwen3.5-9B, so the Transformers Mac/CPU path loads the 9B base model plus this LoRA adapter. Do not use bitsandbytes 4-bit on Mac or CPU. Prefer the Q4_K_M GGUF above when you do not need the Pygame GUI integration.
For direct non-GUI inference from the standalone package on Apple Silicon:
git clone https://huggingface.co/arnavm7/candy-crush-qwen35-grpo-lora
cd candy-crush-qwen35-grpo-lora/standalone
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install torch torchvision torchaudio
pip install -r requirements.txt
PYTHONPATH=src python -m candy_grpo.recommend \
--device mps \
--no-4bit \
--dtype float16 \
--max-new-tokens 16 \
--json
For CPU-only inference:
PYTHONPATH=src python -m candy_grpo.recommend \
--device cpu \
--no-4bit \
--dtype float32 \
--max-new-tokens 16 \
--json
For the full GUI on Apple Silicon, use the GitHub app branch with:
python run_gui.py \
--agent llm_grpo \
--llm-grpo-path arnavm7/candy-crush-qwen35-grpo-lora \
--llm-model-name Qwen/Qwen3.5-9B \
--llm-device mps \
--llm-no-4bit \
--llm-dtype float16 \
--llm-max-new-tokens 16 \
--agent-delay 2.0
Practical memory target: 64 GB unified memory on Mac is recommended. 32 GB can work on some machines with little else open. 16 GB is usually too tight for this 9B PyTorch path.
CPU-only is supported for compatibility, but it is not practical for interactive use. On the Linux test machine used for this project, --device cpu --no-4bit --dtype float32 --max-new-tokens 8 did not return one JSON recommendation within 10 minutes, so the run was stopped.
Evaluation Snapshot
On a 10-board fixed one-swap special-candy eval:
greedy: 337.9
this adapter: 302.0
random: 146.0
ppo: 125.9
dqn: 90.4
Intended Use
This is a research/game-agent adapter for text-based Candy Crush swap recommendation. It is not intended for general-purpose text generation.
- Downloads last month
- 13
4-bit