Quick Start
PMetal exposes a Python extension module via PyO3. Install with maturin from crates/pmetal-py.
Installation
Section titled “Installation”cd crates/pmetal-pypip install maturinmaturin develop --releaseFine-Tuning
Section titled “Fine-Tuning”import pmetal
result = pmetal.finetune( "Qwen/Qwen3-0.6B", "train.jsonl", lora_r=16, learning_rate=2e-4, epochs=3,)print(f"Loss: {result['final_loss']}, Steps: {result['total_steps']}")Inference
Section titled “Inference”# Simple generationtext = pmetal.infer("Qwen/Qwen3-0.6B", "What is 2+2?")print(text)
# With LoRA adaptertext = pmetal.infer( "Qwen/Qwen3-0.6B", "Explain quantum entanglement", lora="./output/lora_weights.safetensors",)print(text)
# With generation parameterstext = pmetal.infer( "Qwen/Qwen3-0.6B", "Tell me a story", temperature=0.8, max_tokens=512,)See Also
Section titled “See Also”- Full Control — Custom training loops and model loading
- Rust SDK — Rust equivalent API