Qweniskit-Coder-1.5B
Qiskit Quantum Circuit Code Generation Adapter
2 min readupdated
This model is trained to act as a planner and generator for the qcagent quantum agent, turning natural language prompts into working Qiskit 1.2.4 circuits. Built on Qwen2.5-Coder-1.5B-Instruct using QLoRA, it is available in both PEFT weights and quantized GGUF versions for Ollama. The adapter is useful for developers exploring quantum computing who need a local assistant to automate circuit writing and validation.
Key features
- Specialized in Qiskit 1.2.4 quantum circuits via the qcagent agent.
- Available in GGUF formats (Q8_0 and Q4_K_M) for running in Ollama and llama.cpp.
- Evaluated on a validation set of 120 tasks with verification through simulation.
- Trained on the multitask-v3 dataset using QLoRA (r=16, α=32).
What you can do
- Run the model locally via Ollama with a ready-made Modelfile for code generation.
- Integrate the adapter into Python scripts using the peft library.
- Use it alongside Qiskit documentation search to plan quantum algorithms.
Example
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct", torch_dtype="bfloat16")
model = PeftModel.from_pretrained(base, "cslemes/qweniskit-coder-1.5b")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct")
Read more
DetailsBenchmarks: 107/120 successful solutions for the Q8_0 version versus 0/120 for the base model.
Hardware: trained on an RTX 3070 (8 GB), the quantized Q8_0 version weighs 1.6 GB.
Limitations: specialized in 24 composition benchmark contracts; requires result verification via simulation.
License: Apache-2.0.










Comments