Instructions to use azuki-digital/qwen3-4b-struct-lora-v11-adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use azuki-digital/qwen3-4b-struct-lora-v11-adapter with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("azuki-digital/qwen3-4b-struct-lora-v4-merged") model = PeftModel.from_pretrained(base_model, "azuki-digital/qwen3-4b-struct-lora-v11-adapter") - Transformers
How to use azuki-digital/qwen3-4b-struct-lora-v11-adapter with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="azuki-digital/qwen3-4b-struct-lora-v11-adapter") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("azuki-digital/qwen3-4b-struct-lora-v11-adapter", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use azuki-digital/qwen3-4b-struct-lora-v11-adapter with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "azuki-digital/qwen3-4b-struct-lora-v11-adapter" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "azuki-digital/qwen3-4b-struct-lora-v11-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/azuki-digital/qwen3-4b-struct-lora-v11-adapter
- SGLang
How to use azuki-digital/qwen3-4b-struct-lora-v11-adapter 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 "azuki-digital/qwen3-4b-struct-lora-v11-adapter" \ --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": "azuki-digital/qwen3-4b-struct-lora-v11-adapter", "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 "azuki-digital/qwen3-4b-struct-lora-v11-adapter" \ --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": "azuki-digital/qwen3-4b-struct-lora-v11-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use azuki-digital/qwen3-4b-struct-lora-v11-adapter with Docker Model Runner:
docker model run hf.co/azuki-digital/qwen3-4b-struct-lora-v11-adapter
qwen3-4b-struct-lora-v11
This repository provides a LoRA adapter fine-tuned on top of:
azuki-digital/qwen3-4b-struct-lora-v4-merged
⚠️ This repository contains LoRA adapter weights only.
The base model must be loaded separately.
Training Objective
This adapter is trained to improve structured output accuracy (JSON / YAML / XML / TOML / CSV). Loss is applied only to the final assistant output, while intermediate reasoning (Chain-of-Thought) is masked.
Training Configuration
| Item | Value |
|---|---|
| Base model | azuki-digital/qwen3-4b-struct-lora-v4-merged |
| Method | LoRA SFT (no quantization, bf16) |
| Max sequence length | 4096 |
| Epochs | 2 |
| Learning rate | 1e-5 |
| Warmup ratio | 0.05 |
| Weight decay | 0.05 |
| LoRA r | 32 |
| LoRA alpha | 64 |
| LoRA dropout | 0.05 |
| Target modules | q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj |
| Mask CoT | Yes (after_marker) |
| Dataset | daichira/structured-3k-mix-sft |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base = "azuki-digital/qwen3-4b-struct-lora-v4-merged"
adapter = "azuki-digital/qwen3-4b-struct-lora-v11"
tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(
base,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(model, adapter)
Sources & License (IMPORTANT)
Training Data • daichira/structured-3k-mix-sft • License: CC-BY-4.0
This dataset is used under the terms of CC-BY-4.0.
Compliance
Users must comply with: 1. Dataset attribution requirements (CC-BY-4.0) 2. Base model license (Apache-2.0) 3. This repository license (Apache-2.0)
- Downloads last month
- 8
Model tree for azuki-digital/qwen3-4b-struct-lora-v11-adapter
Base model
Qwen/Qwen3-4B-Instruct-2507