Instructions to use khazarai/Quantum-ToT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use khazarai/Quantum-ToT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="khazarai/Quantum-ToT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("khazarai/Quantum-ToT") model = AutoModelForCausalLM.from_pretrained("khazarai/Quantum-ToT") 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
- vLLM
How to use khazarai/Quantum-ToT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "khazarai/Quantum-ToT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "khazarai/Quantum-ToT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/khazarai/Quantum-ToT
- SGLang
How to use khazarai/Quantum-ToT 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 "khazarai/Quantum-ToT" \ --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": "khazarai/Quantum-ToT", "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 "khazarai/Quantum-ToT" \ --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": "khazarai/Quantum-ToT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use khazarai/Quantum-ToT 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 khazarai/Quantum-ToT 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 khazarai/Quantum-ToT to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for khazarai/Quantum-ToT to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="khazarai/Quantum-ToT", max_seq_length=2048, ) - Docker Model Runner
How to use khazarai/Quantum-ToT with Docker Model Runner:
docker model run hf.co/khazarai/Quantum-ToT
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("khazarai/Quantum-ToT")
model = AutoModelForCausalLM.from_pretrained("khazarai/Quantum-ToT")
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]:]))Quantum-ToT
Model Details
Quantum-ToT is a fine-tuned variant of Qwen3-1.7B, optimized for Chain-of-Thought (CoT) reasoning in quantum mechanics and quantum computing contexts. This model was trained using the moremilk/CoT_Reasoning_Quantum_Physics_And_Computing dataset — a curated collection of question–answer pairs that go beyond surface-level definitions to show the logical reasoning process behind quantum concepts.
The goal of this fine-tuning is to enhance the model’s ability to:
- Explain quantum principles with structured, step-by-step logic
- Reason through conceptual problems in quantum physics and computing
- Support educational and research applications that require interpretable reasoning chains
Uses
Direct Use
- Educational assistance in quantum physics and quantum computing
- AI tutors or reasoning assistants for STEM learning
- Conceptual reasoning benchmarks involving quantum phenomena
- Research in reasoning-aware model behavior and CoT interpretability
Out of Scope
- Predicting new or unverified physical phenomena
- Running quantum simulations or algorithmic derivations
- Hardware-level quantum design
- Real-time physics predictions
Bias, Risks, and Limitations
- May hallucinate if prompted outside the quantum domain
- Not suitable for advanced quantum algorithm design or experimental predictions
How to Get Started with the Model
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("khazarai/Quantum-ToT")
model = AutoModelForCausalLM.from_pretrained(
"khazarai/Quantum-ToT",
device_map={"": 0}
)
question = """
Explain the Heisenberg Uncertainty Principle in detail, including its mathematical formulation, physical implications, and common misconceptions.
"""
messages = [
{"role" : "user", "content" : question}
]
text = tokenizer.apply_chat_template(
messages,
tokenize = False,
add_generation_prompt = True,
enable_thinking = True,
)
from transformers import TextStreamer
_ = model.generate(
**tokenizer(text, return_tensors = "pt").to("cuda"),
max_new_tokens = 3000,
temperature = 0.6,
top_p = 0.95,
top_k = 20,
streamer = TextStreamer(tokenizer, skip_prompt = True),
)
Dataset
Dataset: moremilk/CoT_Reasoning_Quantum_Physics_And_Computing
This dataset contains rich reasoning-based question–answer pairs covering:
- Core quantum principles: superposition, entanglement, measurement
- Effects of quantum gates (Hadamard, Pauli-X/Y/Z, etc.) on qubits
- Multi-qubit reasoning (e.g., Bell states, entangled systems)
- Basic quantum algorithms and logical operations
- Probabilistic interpretation of measurement outcomes
Each entry includes:
- think block → model’s internal reasoning process
- answer block → final concise explanation or solution
The dataset focuses on conceptual understanding rather than heavy mathematical derivations or complex quantum hardware design.
- Downloads last month
- 29
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="khazarai/Quantum-ToT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)