Text Generation
Transformers
Safetensors
English
Arabic
quasar_long
silx-ai
quasar-preview
quasar
foundation-model
Mixture of Experts
18b
2b-active
long-context
bittensor
sn24
decentralized-training
distillation
hybrid-transformer
loop-transformer
safe-nope
drope
conversational
custom_code
Instructions to use silx-ai/Quasar-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use silx-ai/Quasar-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="silx-ai/Quasar-Preview", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("silx-ai/Quasar-Preview", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use silx-ai/Quasar-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "silx-ai/Quasar-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "silx-ai/Quasar-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/silx-ai/Quasar-Preview
- SGLang
How to use silx-ai/Quasar-Preview 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 "silx-ai/Quasar-Preview" \ --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": "silx-ai/Quasar-Preview", "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 "silx-ai/Quasar-Preview" \ --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": "silx-ai/Quasar-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use silx-ai/Quasar-Preview with Docker Model Runner:
docker model run hf.co/silx-ai/Quasar-Preview
| # Copyright (c) 2023-2025, Songlin Yang, Yu Zhang | |
| import torch | |
| from einops import rearrange | |
| from fla.ops.delta_rule import chunk_delta_rule | |
| from fla.ops.gated_delta_rule import chunk_gated_delta_rule | |
| def chunk_gated_delta_product_ref( | |
| q: torch.Tensor, | |
| k: torch.Tensor, | |
| v: torch.Tensor, | |
| g: torch.Tensor, | |
| beta: torch.Tensor, | |
| num_householder: int, | |
| scale: float = None, | |
| initial_state: torch.Tensor = None, | |
| output_final_state: bool = False, | |
| cu_seqlens: torch.LongTensor | None = None, | |
| use_qk_l2norm_in_kernel: bool = False, | |
| ): | |
| assert q.dtype != torch.float32, "ChunkGatedDeltaProductFunction does not support float32. Please use bfloat16." | |
| B, T, H, K = q.shape | |
| V = v.shape[-1] | |
| assert k.shape == (B, T*num_householder, H, K) | |
| assert v.shape == (B, T*num_householder, H, V) | |
| assert beta.shape == (B, T*num_householder, H) | |
| if g is not None: | |
| assert g.shape == (B, T, H) | |
| q_new = q.new_zeros(B, T, num_householder, H, K) | |
| q_new[:, :, -1] = q | |
| q = rearrange(q_new, 'b t n h d -> b (t n) h d') | |
| if g is not None: | |
| g_new = g.new_zeros(B, T, num_householder, H, dtype=torch.float32) | |
| g_new[:, :, 0] = g | |
| g = rearrange(g_new, 'b t n h -> b (t n) h') | |
| o, final_state = chunk_gated_delta_rule( | |
| q=q, | |
| k=k, | |
| v=v, | |
| g=g, | |
| beta=beta, | |
| initial_state=initial_state, | |
| output_final_state=output_final_state, | |
| cu_seqlens=cu_seqlens * num_householder if cu_seqlens is not None else None, | |
| use_qk_l2norm_in_kernel=use_qk_l2norm_in_kernel, | |
| scale=scale, | |
| ) | |
| else: | |
| o, final_state = chunk_delta_rule( | |
| q=q, | |
| k=k, | |
| v=v, | |
| beta=beta, | |
| initial_state=initial_state, | |
| output_final_state=output_final_state, | |
| cu_seqlens=cu_seqlens * num_householder if cu_seqlens is not None else None, | |
| use_qk_l2norm_in_kernel=use_qk_l2norm_in_kernel, | |
| scale=scale, | |
| ) | |
| o = rearrange(o, 'b (t n) h d -> b t n h d', n=num_householder) | |
| return o[:, :, -1].contiguous(), final_state | |