Text Generation
Transformers
Safetensors
Kernels
English
laguna_dense
moe-to-dense
densification
laguna
code
triton
cuda
reconstruction-pretraining
pretrained
conversational
custom_code
Instructions to use EvanOLeary/laguna-xs2-dense-k8-kernelmix with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EvanOLeary/laguna-xs2-dense-k8-kernelmix with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EvanOLeary/laguna-xs2-dense-k8-kernelmix", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("EvanOLeary/laguna-xs2-dense-k8-kernelmix", trust_remote_code=True, device_map="auto") - Kernels
How to use EvanOLeary/laguna-xs2-dense-k8-kernelmix with Kernels:
# !pip install kernels from kernels import get_kernel # a version (or an explicit revision) is required; see the "Files and versions" tab for the available ones kernel = get_kernel("EvanOLeary/laguna-xs2-dense-k8-kernelmix", version=1) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EvanOLeary/laguna-xs2-dense-k8-kernelmix with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EvanOLeary/laguna-xs2-dense-k8-kernelmix" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EvanOLeary/laguna-xs2-dense-k8-kernelmix", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/EvanOLeary/laguna-xs2-dense-k8-kernelmix
- SGLang
How to use EvanOLeary/laguna-xs2-dense-k8-kernelmix 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 "EvanOLeary/laguna-xs2-dense-k8-kernelmix" \ --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": "EvanOLeary/laguna-xs2-dense-k8-kernelmix", "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 "EvanOLeary/laguna-xs2-dense-k8-kernelmix" \ --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": "EvanOLeary/laguna-xs2-dense-k8-kernelmix", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use EvanOLeary/laguna-xs2-dense-k8-kernelmix with Docker Model Runner:
docker model run hf.co/EvanOLeary/laguna-xs2-dense-k8-kernelmix
Upload config.json with huggingface_hub
Browse files- config.json +197 -0
config.json
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"LagunaForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "configuration_laguna_dense.LagunaConfig",
|
| 9 |
+
"AutoModelForCausalLM": "modeling_laguna_dense.LagunaForCausalLM"
|
| 10 |
+
},
|
| 11 |
+
"bos_token_id": 2,
|
| 12 |
+
"dtype": "bfloat16",
|
| 13 |
+
"eos_token_id": [
|
| 14 |
+
2,
|
| 15 |
+
24
|
| 16 |
+
],
|
| 17 |
+
"gating": true,
|
| 18 |
+
"head_dim": 128,
|
| 19 |
+
"hidden_act": "silu",
|
| 20 |
+
"hidden_size": 2048,
|
| 21 |
+
"initializer_range": 0.02,
|
| 22 |
+
"intermediate_size": 8192,
|
| 23 |
+
"layer_types": [
|
| 24 |
+
"full_attention",
|
| 25 |
+
"sliding_attention",
|
| 26 |
+
"sliding_attention",
|
| 27 |
+
"sliding_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"sliding_attention",
|
| 30 |
+
"sliding_attention",
|
| 31 |
+
"sliding_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"sliding_attention",
|
| 34 |
+
"sliding_attention",
|
| 35 |
+
"sliding_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"sliding_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"sliding_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"sliding_attention",
|
| 43 |
+
"sliding_attention",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"sliding_attention",
|
| 46 |
+
"sliding_attention",
|
| 47 |
+
"sliding_attention",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"sliding_attention",
|
| 50 |
+
"sliding_attention",
|
| 51 |
+
"sliding_attention",
|
| 52 |
+
"full_attention",
|
| 53 |
+
"sliding_attention",
|
| 54 |
+
"sliding_attention",
|
| 55 |
+
"sliding_attention",
|
| 56 |
+
"full_attention",
|
| 57 |
+
"sliding_attention",
|
| 58 |
+
"sliding_attention",
|
| 59 |
+
"sliding_attention",
|
| 60 |
+
"full_attention",
|
| 61 |
+
"sliding_attention",
|
| 62 |
+
"sliding_attention",
|
| 63 |
+
"sliding_attention"
|
| 64 |
+
],
|
| 65 |
+
"max_position_embeddings": 262144,
|
| 66 |
+
"mlp_layer_types": [
|
| 67 |
+
"dense",
|
| 68 |
+
"sparse",
|
| 69 |
+
"sparse",
|
| 70 |
+
"sparse",
|
| 71 |
+
"sparse",
|
| 72 |
+
"sparse",
|
| 73 |
+
"sparse",
|
| 74 |
+
"sparse",
|
| 75 |
+
"sparse",
|
| 76 |
+
"sparse",
|
| 77 |
+
"sparse",
|
| 78 |
+
"sparse",
|
| 79 |
+
"sparse",
|
| 80 |
+
"sparse",
|
| 81 |
+
"sparse",
|
| 82 |
+
"sparse",
|
| 83 |
+
"sparse",
|
| 84 |
+
"sparse",
|
| 85 |
+
"sparse",
|
| 86 |
+
"sparse",
|
| 87 |
+
"sparse",
|
| 88 |
+
"sparse",
|
| 89 |
+
"sparse",
|
| 90 |
+
"sparse",
|
| 91 |
+
"sparse",
|
| 92 |
+
"sparse",
|
| 93 |
+
"sparse",
|
| 94 |
+
"sparse",
|
| 95 |
+
"sparse",
|
| 96 |
+
"sparse",
|
| 97 |
+
"sparse",
|
| 98 |
+
"sparse",
|
| 99 |
+
"sparse",
|
| 100 |
+
"sparse",
|
| 101 |
+
"sparse",
|
| 102 |
+
"sparse",
|
| 103 |
+
"sparse",
|
| 104 |
+
"sparse",
|
| 105 |
+
"sparse",
|
| 106 |
+
"sparse"
|
| 107 |
+
],
|
| 108 |
+
"model_type": "laguna_dense",
|
| 109 |
+
"moe_apply_router_weight_on_input": false,
|
| 110 |
+
"moe_dense_conversion": {
|
| 111 |
+
"dense_routed_intermediate_size": 4096,
|
| 112 |
+
"expert_intermediate_size": 512,
|
| 113 |
+
"k_routed": 8,
|
| 114 |
+
"kind": "routed_moe_to_dense_swiglu",
|
| 115 |
+
"placeholder_weights": "copied_shell_random_routed",
|
| 116 |
+
"shared_expert": "kept",
|
| 117 |
+
"source_model": "poolside/Laguna-XS.2"
|
| 118 |
+
},
|
| 119 |
+
"moe_intermediate_size": 512,
|
| 120 |
+
"moe_routed_scaling_factor": 2.5,
|
| 121 |
+
"moe_router_logit_softcapping": 0.0,
|
| 122 |
+
"num_attention_heads": 48,
|
| 123 |
+
"num_attention_heads_per_layer": [
|
| 124 |
+
48,
|
| 125 |
+
64,
|
| 126 |
+
64,
|
| 127 |
+
64,
|
| 128 |
+
48,
|
| 129 |
+
64,
|
| 130 |
+
64,
|
| 131 |
+
64,
|
| 132 |
+
48,
|
| 133 |
+
64,
|
| 134 |
+
64,
|
| 135 |
+
64,
|
| 136 |
+
48,
|
| 137 |
+
64,
|
| 138 |
+
64,
|
| 139 |
+
64,
|
| 140 |
+
48,
|
| 141 |
+
64,
|
| 142 |
+
64,
|
| 143 |
+
64,
|
| 144 |
+
48,
|
| 145 |
+
64,
|
| 146 |
+
64,
|
| 147 |
+
64,
|
| 148 |
+
48,
|
| 149 |
+
64,
|
| 150 |
+
64,
|
| 151 |
+
64,
|
| 152 |
+
48,
|
| 153 |
+
64,
|
| 154 |
+
64,
|
| 155 |
+
64,
|
| 156 |
+
48,
|
| 157 |
+
64,
|
| 158 |
+
64,
|
| 159 |
+
64,
|
| 160 |
+
48,
|
| 161 |
+
64,
|
| 162 |
+
64,
|
| 163 |
+
64
|
| 164 |
+
],
|
| 165 |
+
"num_experts": 256,
|
| 166 |
+
"num_experts_per_tok": 8,
|
| 167 |
+
"num_hidden_layers": 40,
|
| 168 |
+
"num_key_value_heads": 8,
|
| 169 |
+
"output_router_logits": false,
|
| 170 |
+
"pad_token_id": 9,
|
| 171 |
+
"partial_rotary_factor": null,
|
| 172 |
+
"rms_norm_eps": 1e-06,
|
| 173 |
+
"rope_parameters": {
|
| 174 |
+
"full_attention": {
|
| 175 |
+
"attention_factor": 1.0,
|
| 176 |
+
"beta_fast": 64.0,
|
| 177 |
+
"beta_slow": 1.0,
|
| 178 |
+
"factor": 64.0,
|
| 179 |
+
"original_max_position_embeddings": 4096,
|
| 180 |
+
"partial_rotary_factor": 0.5,
|
| 181 |
+
"rope_theta": 500000.0,
|
| 182 |
+
"rope_type": "yarn"
|
| 183 |
+
},
|
| 184 |
+
"sliding_attention": {
|
| 185 |
+
"partial_rotary_factor": 1.0,
|
| 186 |
+
"rope_theta": 10000.0,
|
| 187 |
+
"rope_type": "default"
|
| 188 |
+
}
|
| 189 |
+
},
|
| 190 |
+
"router_aux_loss_coef": 0.0,
|
| 191 |
+
"shared_expert_intermediate_size": 512,
|
| 192 |
+
"sliding_window": 512,
|
| 193 |
+
"tie_word_embeddings": false,
|
| 194 |
+
"transformers_version": "5.9.0",
|
| 195 |
+
"use_cache": false,
|
| 196 |
+
"vocab_size": 100352
|
| 197 |
+
}
|