PrimeIntellect/Reverse-Text-SFT
Viewer • Updated • 1k • 1.44k • 5
How to use PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-SFT with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-SFT")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
pipe(text=messages) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-SFT")
model = AutoModelForMultimodalLM.from_pretrained("PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-SFT", device_map="auto")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
inputs = processor.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=256)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-SFT with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-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": "PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-SFT",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'docker model run hf.co/PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-SFT
How to use PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-SFT with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-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": "PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-SFT",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'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 "PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-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": "PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-SFT",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'How to use PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-SFT with Docker Model Runner:
docker model run hf.co/PrimeIntellect/Qwen3.5-0.8B-Reverse-Text-SFT
A short SFT fine-tune of Qwen/Qwen3.5-0.8B on PrimeIntellect/Reverse-Text-SFT.
It is a small, deliberately under-trained starting point for reverse-text RL, made for the planned move of the prime-rl CI RL tests from PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT to Qwen3.5. It is not meant for general use.
21814b401 (branch ci/qwen3_5-ci, contains the Qwen3.5 tied lm_head fix #3863 and the CP fix #3864).uv run sft @ sft.toml), 1 H200:max_steps = 10
[model]
name = "Qwen/Qwen3.5-0.8B"
[data]
name = "PrimeIntellect/Reverse-Text-SFT"
seq_len = 4096
batch_size = 32
[optim]
lr = 2e-5
<think>\n\n</think>\n\n prefix, the same as RL generation.Qwen3_5ForConditionalGeneration like the base model.reverse-text eval reward (LCS ratio, 256 prompts, temperature 1, 128 max tokens): 0.31 (base model: 0.03 on 32 prompts).