Instructions to use projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3", filename="Instinct-Python-Coder-Gemma4-12B-KimiK3-Q8_0.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 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 projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0 # Run inference directly in the terminal: llama cli -hf projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0 # Run inference directly in the terminal: llama cli -hf projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0
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 projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0
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 projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0
Use Docker
docker model run hf.co/projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0
- LM Studio
- Jan
- vLLM
How to use projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0
- Ollama
How to use projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 with Ollama:
ollama run hf.co/projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0
- Unsloth Studio
How to use projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 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 projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 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 projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 to start chatting
- Pi
How to use projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0
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": "projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0
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 projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0
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 "projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0" \ --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 projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 with Docker Model Runner:
docker model run hf.co/projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0
- Lemonade
How to use projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3:Q8_0
Run and chat with the model
lemonade run user.Instinct-Python-Coder-Gemma4-12B-KimiK3-Q8_0
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)Instinct-Python-Coder-Gemma4-12B-KimiK3
Instinct-Python-Coder-Gemma4-12B-KimiK3 is a general-purpose Python coder that thinks
briefly, then answers. We took the highly capable Gemma 4 12B model and taught it
to perform better in Python coding with much more concise reasoning in its
<think></think> channel, leading to faster inference, a shorter context window,
and cost savings for the end user. The reasoning style is distilled from Kimi K3:
the model works through the approach in a few lines, then hands back the code.
Evaluation
We measured first-attempt accuracy on a held-out set of 228 Python tasks: one greedy completion per task, each graded automatically.
| Gemma 4 12B (base) | Instinct | |
|---|---|---|
| Solved | 40 / 228 (17.5%) | 81 / 228 (35.5%) |
| Ran out of budget without writing code | 90 | 28 |
| Time to run the full set (batched) | 233.6 min | 126.8 min |
With a 35.5% first-attempt accuracy, our Python Coder Instinct model preserved 62% of Kimi K3's thinking capability: Kimi K3 itself reaches about 57.3% first-attempt accuracy on a broader Python pool under the same kind of check. For comparison, the base Gemma 4 12B model has only 17.5% accuracy, so we more than doubled it.
On 90 of the 228 tasks the base model ran out of its budget without ever writing code; the finetune cut that to 28. These gains trace to the same change: the model reaches the answer instead of thinking until it runs out of room.
Training
Fine-tuned on 1.87M post-training tokens, passed over twice for 3.73M tokens in total, at a sequence length of 8,192.
Limitations
This is one 12B model measured once with greedy decoding, so treat 35.5% as a single reading with no error bar. It was tuned and tested on Python, and nothing else was measured here. It inherits Gemma 4's behavior and limitations.
The 17.5% base-model figure above was measured with a plain "explain your approach,
then write code" prompt — not the <think> instruction this fine-tune was trained on.
Scoring the same base weights with a prompt that explicitly asks for a <think> block
(the format this model actually uses) gives 3.5%, not 17.5%: the untuned model mostly
rambles trying to follow an unfamiliar instruction instead of writing code. So part of
the 17.5% → 35.5% gap is this model learning to follow that instruction format, not
purely a coding-skill improvement. The absolute 35.5% is unaffected either way.
License and lineage
Base model: unsloth/gemma-4-12b-it, which ships
under the Apache 2.0 license (see its own model card's frontmatter — license: apache-2.0),
not the standard Gemma Terms of Use. This fine-tune inherits that Apache 2.0 license. Training data
is distilled from Kimi K3 (Moonshot AI); Moonshot gave written permission for this project to train
on and redistribute Kimi K3-derived outputs and models (recorded in this repo's
docs/kimi-k3-distillation.md).
Usage
It ships as a single Q8_0 GGUF, roughly 13 GB on disk, and runs on a GPU or Mac with about 16 GB of memory. Serve it with llama.cpp:
llama-server -m Instinct-Python-Coder-Gemma4-12B-KimiK3-Q8_0.gguf -ngl 99 -c 8192
That exposes an OpenAI-compatible endpoint at http://localhost:8080/v1, and the
Gemma 4 chat template is baked into the GGUF, so turns and the thinking channel are
formatted for you. It runs anywhere GGUF runs, and any tool that speaks the OpenAI
chat API can drive it:
- Runtimes and apps: llama.cpp, Ollama, LM Studio, Jan, KoboldCpp
- Coding agents and harnesses: opencode, pi, Hermes, Aider, Cline, Continue
Describe what you want in plain language and it replies with a short pass of reasoning followed by the code:
User: Return the first character in a string that appears only once, or None.
<think>
Count characters in one pass, then scan again and return the first with count 1. O(n).
</think>
```python
from collections import Counter
def first_unique(s):
counts = Counter(s)
for ch in s:
if counts[ch] == 1:
return ch
return None
```
- Downloads last month
- -
8-bit
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="projectj/Instinct-Python-Coder-Gemma4-12B-KimiK3", filename="Instinct-Python-Coder-Gemma4-12B-KimiK3-Q8_0.gguf", )