Text Generation
Transformers
Safetensors
English
Arabic
quasar
silx-ai
foundation-model
3b
Mixture of Experts
long-context
bittensor
sn24
distillation
hybrid-transformer
conversational
custom_code
Instructions to use silx-ai/Quasar-3B-A1B-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use silx-ai/Quasar-3B-A1B-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="silx-ai/Quasar-3B-A1B-Preview", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("silx-ai/Quasar-3B-A1B-Preview", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use silx-ai/Quasar-3B-A1B-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-3B-A1B-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-3B-A1B-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/silx-ai/Quasar-3B-A1B-Preview
- SGLang
How to use silx-ai/Quasar-3B-A1B-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-3B-A1B-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-3B-A1B-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-3B-A1B-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-3B-A1B-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use silx-ai/Quasar-3B-A1B-Preview with Docker Model Runner:
docker model run hf.co/silx-ai/Quasar-3B-A1B-Preview
Update config.json
Browse files- config.json +44 -15
config.json
CHANGED
|
@@ -1,24 +1,53 @@
|
|
| 1 |
{
|
| 2 |
"model_type": "quasar",
|
| 3 |
-
"auto_map": {
|
| 4 |
-
"AutoConfig": "configuration_quasar.QuasarConfig",
|
| 5 |
-
"AutoModelForCausalLM": "modeling_quasar.QuasarForCausalLM"
|
| 6 |
-
},
|
| 7 |
"vocab_size": 248320,
|
| 8 |
-
"d_model":
|
| 9 |
-
"n_heads":
|
| 10 |
-
"n_layers":
|
| 11 |
-
"d_ff":
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
-
"
|
| 15 |
-
"
|
| 16 |
-
"
|
|
|
|
|
|
|
| 17 |
"quasar_layers": 4,
|
| 18 |
"gated_layers": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
"dense_input_layers": 4,
|
| 20 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
"num_loops": 1,
|
|
|
|
|
|
|
| 22 |
"rope_theta": 1000000.0,
|
| 23 |
-
"hidden_act": "silu"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"model_type": "quasar",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
"vocab_size": 248320,
|
| 4 |
+
"d_model": 1536,
|
| 5 |
+
"n_heads": 12,
|
| 6 |
+
"n_layers": 24,
|
| 7 |
+
"d_ff": 4096,
|
| 8 |
+
"head_dim": 128,
|
| 9 |
+
"max_seq_len": 16384,
|
| 10 |
+
"dropout": 0.0,
|
| 11 |
+
"rms_norm_eps": 1e-6,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"use_cache": true,
|
| 14 |
+
"tie_word_embeddings": false,
|
| 15 |
"quasar_layers": 4,
|
| 16 |
"gated_layers": 2,
|
| 17 |
+
"use_gla_first": false,
|
| 18 |
+
"use_short_conv": true,
|
| 19 |
+
"conv_size": 4,
|
| 20 |
+
"conv_bias": false,
|
| 21 |
+
"allow_neg_eigval": false,
|
| 22 |
+
"attn_mode": "chunk",
|
| 23 |
+
"expand_k": 0.5,
|
| 24 |
+
"expand_v": 1.0,
|
| 25 |
+
"gla_mode": "chunk",
|
| 26 |
+
"memory_slots": 128,
|
| 27 |
+
"memory_dim": 128,
|
| 28 |
+
"moe_type": "bigmac",
|
| 29 |
+
"num_shared_experts": 1,
|
| 30 |
+
"num_routed_experts": 64,
|
| 31 |
+
"top_k": 4,
|
| 32 |
+
"shared_expert_size": 3072,
|
| 33 |
+
"routed_expert_size": 256,
|
| 34 |
"dense_input_layers": 4,
|
| 35 |
+
"bigmac_r": 0.25,
|
| 36 |
+
"moe_z_loss_coeff": 0.0001,
|
| 37 |
+
"moe_aux_loss_coeff": 0.0001,
|
| 38 |
+
"smebu_kappa": 2.0,
|
| 39 |
+
"smebu_lambda": 0.002,
|
| 40 |
+
"smebu_beta": 0.5,
|
| 41 |
"num_loops": 1,
|
| 42 |
+
"use_looped_injection": false,
|
| 43 |
+
"looped_injection_init": 0.1,
|
| 44 |
"rope_theta": 1000000.0,
|
| 45 |
+
"hidden_act": "silu",
|
| 46 |
+
"residual_scale": 0.1,
|
| 47 |
+
"bos_token_id": 1,
|
| 48 |
+
"eos_token_id": 2,
|
| 49 |
+
"auto_map": {
|
| 50 |
+
"AutoConfig": "configuration_quasar.QuasarConfig",
|
| 51 |
+
"AutoModelForCausalLM": "modeling_quasar.QuasarForCausalLM"
|
| 52 |
+
}
|
| 53 |
}
|