Instructions to use FutureMa/qwen35-4b-lora-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use FutureMa/qwen35-4b-lora-sft with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("/ephemeral/models/Qwen3.5-4B") model = PeftModel.from_pretrained(base_model, "FutureMa/qwen35-4b-lora-sft") - Transformers
How to use FutureMa/qwen35-4b-lora-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FutureMa/qwen35-4b-lora-sft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("FutureMa/qwen35-4b-lora-sft", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FutureMa/qwen35-4b-lora-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FutureMa/qwen35-4b-lora-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FutureMa/qwen35-4b-lora-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FutureMa/qwen35-4b-lora-sft
- SGLang
How to use FutureMa/qwen35-4b-lora-sft 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 "FutureMa/qwen35-4b-lora-sft" \ --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": "FutureMa/qwen35-4b-lora-sft", "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 "FutureMa/qwen35-4b-lora-sft" \ --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": "FutureMa/qwen35-4b-lora-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FutureMa/qwen35-4b-lora-sft with Docker Model Runner:
docker model run hf.co/FutureMa/qwen35-4b-lora-sft
Qwen3.5-4B LoRA SFT (checkpoint-971)
LoRA adapter fine-tuned on stepfun-ai/Step-3.5-Flash-SFT using Axolotl on a single NVIDIA H100 PCIe 80GB.
This is checkpoint-971 (epoch=1.0), the best checkpoint by eval loss (0.787).
Training Details
| Base model | Qwen/Qwen3.5-4B |
| Dataset | stepfun-ai/Step-3.5-Flash-SFT (chunk_0, ~14.5k samples) |
| LoRA rank | 128 |
| LoRA alpha | 256 |
| Trainable params | 195M / 4.73B (4.13%) |
| Best eval loss | 0.787 (epoch 1.0) |
| Hardware | 1× H100 PCIe 80GB |
| Training time | ~3 hours |
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-4B", dtype=torch.bfloat16, device_map="cuda")
tokenizer = AutoTokenizer.from_pretrained("FutureMa/qwen35-4b-lora-sft")
model = PeftModel.from_pretrained(base, "FutureMa/qwen35-4b-lora-sft")
messages = [{"role": "user", "content": "Explain what a lambda function is in Python."}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
inputs = tokenizer(text, return_tensors="pt").to("cuda")
out = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Framework versions
- PEFT 0.18.1
- Axolotl (latest)
- Downloads last month
- 1