Text Generation
Transformers
Safetensors
GGUF
English
qwen2
decompilation
reverse-engineering
python
bytecode
code
verified-generation
conversational
text-generation-inference
Instructions to use BlazingCustoms/pybytecode-v3-1.5b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BlazingCustoms/pybytecode-v3-1.5b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BlazingCustoms/pybytecode-v3-1.5b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BlazingCustoms/pybytecode-v3-1.5b") model = AutoModelForCausalLM.from_pretrained("BlazingCustoms/pybytecode-v3-1.5b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use BlazingCustoms/pybytecode-v3-1.5b 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 BlazingCustoms/pybytecode-v3-1.5b:F16 # Run inference directly in the terminal: llama cli -hf BlazingCustoms/pybytecode-v3-1.5b:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf BlazingCustoms/pybytecode-v3-1.5b:F16 # Run inference directly in the terminal: llama cli -hf BlazingCustoms/pybytecode-v3-1.5b:F16
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 BlazingCustoms/pybytecode-v3-1.5b:F16 # Run inference directly in the terminal: ./llama-cli -hf BlazingCustoms/pybytecode-v3-1.5b:F16
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 BlazingCustoms/pybytecode-v3-1.5b:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf BlazingCustoms/pybytecode-v3-1.5b:F16
Use Docker
docker model run hf.co/BlazingCustoms/pybytecode-v3-1.5b:F16
- LM Studio
- Jan
- vLLM
How to use BlazingCustoms/pybytecode-v3-1.5b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BlazingCustoms/pybytecode-v3-1.5b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BlazingCustoms/pybytecode-v3-1.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BlazingCustoms/pybytecode-v3-1.5b:F16
- SGLang
How to use BlazingCustoms/pybytecode-v3-1.5b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "BlazingCustoms/pybytecode-v3-1.5b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BlazingCustoms/pybytecode-v3-1.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "BlazingCustoms/pybytecode-v3-1.5b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BlazingCustoms/pybytecode-v3-1.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use BlazingCustoms/pybytecode-v3-1.5b with Ollama:
ollama run hf.co/BlazingCustoms/pybytecode-v3-1.5b:F16
- Unsloth Studio
How to use BlazingCustoms/pybytecode-v3-1.5b 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 BlazingCustoms/pybytecode-v3-1.5b 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 BlazingCustoms/pybytecode-v3-1.5b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for BlazingCustoms/pybytecode-v3-1.5b to start chatting
- Pi
How to use BlazingCustoms/pybytecode-v3-1.5b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf BlazingCustoms/pybytecode-v3-1.5b:F16
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": "BlazingCustoms/pybytecode-v3-1.5b:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use BlazingCustoms/pybytecode-v3-1.5b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf BlazingCustoms/pybytecode-v3-1.5b:F16
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 "BlazingCustoms/pybytecode-v3-1.5b:F16" \ --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 BlazingCustoms/pybytecode-v3-1.5b with Docker Model Runner:
docker model run hf.co/BlazingCustoms/pybytecode-v3-1.5b:F16
- Lemonade
How to use BlazingCustoms/pybytecode-v3-1.5b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull BlazingCustoms/pybytecode-v3-1.5b:F16
Run and chat with the model
lemonade run user.pybytecode-v3-1.5b-F16
List all available models
lemonade list
- Hermes Agent
How to use BlazingCustoms/pybytecode-v3-1.5b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf BlazingCustoms/pybytecode-v3-1.5b:F16
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 BlazingCustoms/pybytecode-v3-1.5b:F16
Run Hermes
hermes
- Atomic Chat
File size: 8,412 Bytes
0b19a1b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | # PyBytecode evaluation harness
Grades Python 3.12 decompilations under a **sound** oracle: recompile the prediction and require
the resulting code object to be byte-identical to the reference's, recursively, including
docstrings and `co_exceptiontable`. A pass is a proof, not a plausibility judgement.
Its limits are real and are documented in **[`../ORACLE-LIMITS.md`](../ORACLE-LIMITS.md)**:
a 0.33% false-reject floor on foreign `.pyc`, a hard dependency on matching the producer's
optimization level, and the fact that the 100% pre-flight this harness prints proves far less
than it looks like it does. Read that before quoting any number from here.
**Everything here runs from a fresh clone with the Python standard library alone.** No model, no
GPU, no network, no API key, no PyLingual, and no path outside the clone. Verified β see
*Fresh-clone verification* below.
---
## Requirements
| To do this | You need |
|---|---|
| Grade cached generations (every published number) | CPython **3.12.x**. Nothing else. |
| Generate new predictions | the above + any OpenAI-compatible server |
| Rebuild a benchmark from its source dataset | the above + `pip install -r requirements.txt` + authenticated `gh` |
| Compare against PyLingual | the above + the optional extra (`requirements-pylingual.txt`) |
CPython 3.12 is not a preference. The benchmark is 3.12 bytecode; on 3.11 or 3.13 the reference
`.pyc` files will not compare and pre-flight will fail loudly rather than score silently.
Configuration is environment-only β `PYBYTECODE_ENDPOINT`, `PYBYTECODE_MODEL`,
`PYBYTECODE_API_KEY` (see `config.py`). Nothing is hard-coded to a machine.
---
## Reproduce every published number, from cache
No model, no GPU, no network. The expensive part β the generations β is cached in this bundle, so
every number below is re-derivable for the cost of a few CPU-minutes.
```bash
cd harness
B=../benchmarks/csn-3.12-licensed/bench.jsonl
G=../generations
# 1. Prove the harness is sound before believing any score it prints.
python3 grade.py --bench $B --self-test-only --out ../results/selftest_csn.json
# 2. Full scoring: tuned greedy, untuned-base control, verified best-of-N,
# with repo-clustered confidence intervals and per-row verdicts.
python3 analyze_scores.py --bench $B \
--greedy $G/gen_v3_csn600.jsonl \
--samples $G/boN_v3_csn600.jsonl \
--base $G/gen_base_csn600.jsonl \
--out ../results/scores_csn600.json --rows-out ../results/rows_csn600.jsonl
```
`../results/scores_csn600.json` holds the aggregates and intervals;
`../results/rows_csn600.jsonl` holds a per-row verdict for all 600 rows β repo, function, commit
SHA, SPDX, instruction count, whether tuned greedy certified, whether the untuned base certified,
and the index of the first passing sample. Every headline number is recomputable from that file
alone.
The MBPP set is graded the same way:
```bash
python3 grade.py --bench ../benchmarks/mbpp-ood/bench.jsonl \
--self-test-only --out ../results/selftest_mbpp.json
```
### Confidence intervals are repo-clustered
Rows from the same repository are not independent β shared author, house style, shared helpers β
so a plain binomial interval understates uncertainty. `analyze_scores.py` resamples
**repositories** with replacement (the cluster bootstrap, 10,000 draws) and reports the 2.5th and
97.5th percentiles, alongside the naive binomial interval and the design effect so the cost of
clustering is visible rather than assumed.
This is meaningful here only because the benchmark caps any repository at ~1% of rows. On the
superseded 400-row set, one repository supplied 15% and a clustered interval would have been the
only honest one to quote β and none was.
## Generate predictions (needs a model)
```bash
export PYBYTECODE_ENDPOINT=http://localhost:1234/v1
export PYBYTECODE_MODEL=pybytecode-v3-1.5b
python3 generate.py --bench ../benchmarks/csn-3.12-licensed/bench.jsonl --out gen.jsonl
python3 generate.py --bench ../benchmarks/csn-3.12-licensed/bench.jsonl \
--out boN.jsonl --temperature 0.8 --samples 32 # for best-of-N
python3 grade.py --bench ../benchmarks/csn-3.12-licensed/bench.jsonl \
--gen gen.jsonl --out ../results/mine.json
```
`generate.py` is resumable: an interrupted run is completed by re-running the same command.
---
## PyLingual β optional, user-installed, never vendored
PyLingual is `GPL-3.0-only`. It is **not** a dependency of this harness and is **not** included
in this repository in any form. We import exactly one symbol from it,
`pylingual.equivalence_check.compare_pyc`, and only at grading time, so that the head-to-head
comparison uses *their* definition of a perfect decompilation rather than our reimplementation of
it. Nobody can say we loosened their bar.
Without it: `dual_oracle.py` runs and reports `pylingual_available: false`, with their-oracle
columns `null` β explicitly absent, never silently zeroed. `grade.py --oracle theirs` exits with
an explanation. Everything else is unaffected.
Install instructions and the exact commit we measured: `requirements-pylingual.txt`.
---
## The self-tests, and why they can refuse
Two gates run before any score is printed:
- **Pre-flight** β grade every reference label against itself. A byte-perfect model must score
100%. Anything less means the harness is broken, not that the model is bad.
**It is trivial by construction and is NOT evidence of soundness**: it compares `compile(x)`
with `compile(x)`, so any deterministic function of the source scores 100%, including a stub
that ignores the bytecode. It detects a broken harness (mismatched `.pyc`, wrong Python minor,
corrupt row) and nothing more. Soundness evidence is the mutation test and the 18 blind-spot
probes β see `../ORACLE-LIMITS.md` Β§1.
- **Mutation test** β corrupt each label (swap `+`/`-`, flip a comparison, break a `return`) and
confirm the oracle kills it. A grader that passes mutants is a stub and its scores are noise.
If either is below 100% the command **refuses to print a score**. That is intended behaviour.
Mutation candidates that do not change the program's AST are discarded rather than counted, so a
comment-only rewrite cannot be mistaken for a surviving mutant. This matters: the original harness
generated `return None` β `return None #None` and would have scored that as a survivor.
It reported 131/131 only because no row in its sample had a bare `return None`; the new 600-row
benchmark has three, and the un-filtered generator scored 97.48% and correctly refused to run.
The fix is in the mutation generator; the oracle was never loosened.
Measured on the current benchmarks:
| Benchmark | Pre-flight | Mutation kill rate |
|---|---|---|
| `csn-3.12-licensed` (n=600) | 600/600 = 100% | 116/116 = 100% |
| `mbpp-ood` (n=383) | 383/383 = 100% | 199/199 = 100% |
---
## Fresh-clone verification
Performed 2026-08-04. `git clone` into a scratch directory, no `PYBYTECODE_*` variables set, no
PyLingual installed (`ModuleNotFoundError`), no model running, working directory not the original
path:
```
1. self-test csn-3.12-licensed PRE-FLIGHT 600/600 = 100.0% MUTATION 116/116 = 100.0% SOUND
2. dual_oracle on cached CSN n=400 ours 335 = 83.75% pylingual_available: false
3. bestofn_grade on cached CSN greedy 335 certified@32 373 = 93.25%
```
Identical to the published values. Git LFS is required to materialise the cached generations β
see `../RELEASE-BLOCKERS.md`, which records the state of the LFS objects on the remote.
---
## Files
```
config.py paths + endpoint; the only environment-aware module
common.py oracles, fence stripping, pre-flight, mutation test
grade.py score under one oracle (ours by default), self-tests first
dual_oracle.py score under both oracles; degrades gracefully without PyLingual
bestofn_grade.py verified best-of-N from cached samples
generate.py the only script that needs a model
pybytecode_core/ verify.py + rep.py, copied verbatim from scripts/pybytecode/
```
`pybytecode_core/` is a byte-identical copy so the harness is self-contained. Verify it:
```
sha256 45ca921f86c73622d5b46295b9264e4a68bd697dce94e27a786c73f4416319b9 verify.py
sha256 1ba81c307c72e83d2c6a6eceb9936bf3f13645d267df3c7c676d421b9b2f43d9 rep.py
```
|