Instructions to use raxcore-dev/rax-3.5-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use raxcore-dev/rax-3.5-chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="raxcore-dev/rax-3.5-chat") 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)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("raxcore-dev/rax-3.5-chat") model = AutoModelForImageTextToText.from_pretrained("raxcore-dev/rax-3.5-chat") 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use raxcore-dev/rax-3.5-chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "raxcore-dev/rax-3.5-chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "raxcore-dev/rax-3.5-chat", "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" } } ] } ] }'Use Docker
docker model run hf.co/raxcore-dev/rax-3.5-chat
- SGLang
How to use raxcore-dev/rax-3.5-chat 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 "raxcore-dev/rax-3.5-chat" \ --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": "raxcore-dev/rax-3.5-chat", "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" } } ] } ] }'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 "raxcore-dev/rax-3.5-chat" \ --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": "raxcore-dev/rax-3.5-chat", "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 Runner
How to use raxcore-dev/rax-3.5-chat with Docker Model Runner:
docker model run hf.co/raxcore-dev/rax-3.5-chat
davytheprogrammer commited on
Commit ·
89f9833
0
Parent(s):
Update README for Hugging Face
Browse files
README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
pipeline_tag: image-text-to-text
|
| 5 |
+
tags:
|
| 6 |
+
- multimodal
|
| 7 |
+
- vision-language
|
| 8 |
+
- chat
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# Rax 3.5 Chat
|
| 12 |
+
|
| 13 |
+
Rax 3.5 Chat is a compact 2B parameter multimodal model for vision-language understanding and conversational AI. It supports text and image inputs with extended context up to 262K tokens.
|
| 14 |
+
|
| 15 |
+
## Model Details
|
| 16 |
+
|
| 17 |
+
- **Parameters**: ~2B
|
| 18 |
+
- **Context Length**: 262,144 tokens
|
| 19 |
+
- **Input Modalities**: Text + Images
|
| 20 |
+
- **Attention**: Hybrid linear + full attention (24 layers)
|
| 21 |
+
- **Vision Encoder**: 24-layer transformer with 1024 hidden size
|
| 22 |
+
- **Text Hidden Size**: 2048
|
| 23 |
+
- **Precision**: BFloat16
|
| 24 |
+
|
| 25 |
+
## Key Features
|
| 26 |
+
|
| 27 |
+
- **Multimodal Understanding**: Processes text and images in unified reasoning
|
| 28 |
+
- **Long Context**: Supports up to 262K tokens for extended conversations
|
| 29 |
+
- **Efficient Architecture**: Hybrid attention mechanism for optimal performance
|
| 30 |
+
- **Production Ready**: Compatible with vLLM, SGLang, and Transformers
|
| 31 |
+
|
| 32 |
+
## Usage
|
| 33 |
+
|
| 34 |
+
### With Transformers
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
from transformers import AutoModelForVision2Seq, AutoProcessor
|
| 38 |
+
from PIL import Image
|
| 39 |
+
|
| 40 |
+
model = AutoModelForVision2Seq.from_pretrained("raxcore/Rax-3.5-Chat", trust_remote_code=True)
|
| 41 |
+
processor = AutoProcessor.from_pretrained("raxcore/Rax-3.5-Chat", trust_remote_code=True)
|
| 42 |
+
|
| 43 |
+
# Text-only conversation
|
| 44 |
+
messages = [{"role": "user", "content": "What is the capital of France?"}]
|
| 45 |
+
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 46 |
+
inputs = processor(text=text, return_tensors="pt")
|
| 47 |
+
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 48 |
+
print(processor.decode(outputs[0], skip_special_tokens=True))
|
| 49 |
+
|
| 50 |
+
# With image
|
| 51 |
+
image = Image.open("image.jpg")
|
| 52 |
+
messages = [{"role": "user", "content": [{"type": "image"}, {"type": "text", "text": "Describe this image."}]}]
|
| 53 |
+
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 54 |
+
inputs = processor(text=text, images=image, return_tensors="pt")
|
| 55 |
+
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 56 |
+
print(processor.decode(outputs[0], skip_special_tokens=True))
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
### With vLLM
|
| 60 |
+
|
| 61 |
+
```bash
|
| 62 |
+
vllm serve raxcore/Rax-3.5-Chat --port 8000 --max-model-len 8192
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
```python
|
| 66 |
+
from openai import OpenAI
|
| 67 |
+
client = OpenAI(base_url="http://localhost:8000/v1", api_key="token")
|
| 68 |
+
|
| 69 |
+
response = client.chat.completions.create(
|
| 70 |
+
model="raxcore/Rax-3.5-Chat",
|
| 71 |
+
messages=[{"role": "user", "content": "Hello!"}],
|
| 72 |
+
temperature=0.7,
|
| 73 |
+
max_tokens=512
|
| 74 |
+
)
|
| 75 |
+
print(response.choices[0].message.content)
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
## Architecture Highlights
|
| 79 |
+
|
| 80 |
+
- **Hybrid Attention**: Alternates between linear attention and full attention layers for efficiency
|
| 81 |
+
- **Vision Encoder**: 24-layer transformer with patch size 16 and spatial merge 2x2
|
| 82 |
+
- **Efficient KV Cache**: 2 key-value heads for reduced memory footprint
|
| 83 |
+
- **Multi-resolution Position Embeddings**: Optimized for long-context understanding
|
| 84 |
+
|
| 85 |
+
## Best Practices
|
| 86 |
+
|
| 87 |
+
- Use temperature 0.6–0.8 for factual tasks, 0.8–1.0 for creative tasks
|
| 88 |
+
- For long context (>32K tokens), ensure sufficient GPU memory
|
| 89 |
+
- Enable trust_remote_code when loading the model
|
| 90 |
+
|
| 91 |
+
## Limitations
|
| 92 |
+
|
| 93 |
+
- 2B parameters may limit complex reasoning compared to larger models
|
| 94 |
+
- Vision understanding optimized for natural images
|
| 95 |
+
- Long context requires significant memory resources
|
| 96 |
+
|
| 97 |
+
## License
|
| 98 |
+
|
| 99 |
+
Apache 2.0
|
| 100 |
+
|
| 101 |
+
## Citation
|
| 102 |
+
|
| 103 |
+
```bibtex
|
| 104 |
+
@misc{rax3.5chat,
|
| 105 |
+
title={Rax 3.5 Chat: Efficient Multimodal Assistant Model},
|
| 106 |
+
author={Raxcore},
|
| 107 |
+
year={2026}
|
| 108 |
+
}
|
| 109 |
+
```
|