Instructions to use SparseLLM/DECO-0.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SparseLLM/DECO-0.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SparseLLM/DECO-0.5B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("SparseLLM/DECO-0.5B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use SparseLLM/DECO-0.5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SparseLLM/DECO-0.5B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SparseLLM/DECO-0.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SparseLLM/DECO-0.5B
- SGLang
How to use SparseLLM/DECO-0.5B 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 "SparseLLM/DECO-0.5B" \ --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": "SparseLLM/DECO-0.5B", "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 "SparseLLM/DECO-0.5B" \ --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": "SparseLLM/DECO-0.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SparseLLM/DECO-0.5B with Docker Model Runner:
docker model run hf.co/SparseLLM/DECO-0.5B
| { | |
| "architectures": [ | |
| "BlockFFNForCausalLM" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_blockffn.BlockFFNConfig", | |
| "AutoModel": "modeling_blockffn.BlockFFNModel", | |
| "AutoModelForCausalLM": "modeling_blockffn.BlockFFNForCausalLM" | |
| }, | |
| "bos_token_id": 1, | |
| "eos_token_id": [ | |
| 2, | |
| 73440 | |
| ], | |
| "pad_token_id": 2, | |
| "hidden_act": "silu", | |
| "hidden_size": 1280, | |
| "initializer_range": 0.1, | |
| "intermediate_size": 10240, | |
| "head_dim": 128, | |
| "max_position_embeddings": 4096, | |
| "model_type": "blockffn", | |
| "num_attention_heads": 10, | |
| "num_hidden_layers": 32, | |
| "num_key_value_heads": 2, | |
| "rms_norm_eps": 1e-05, | |
| "rope_scaling": null, | |
| "rope_theta": 10000.0, | |
| "torch_dtype": "bfloat16", | |
| "transformers_version": "4.36.0", | |
| "use_cache": true, | |
| "vocab_size": 73448, | |
| "use_mup": false, | |
| "num_experts": 77, | |
| "moe_ffn_hidden_size": 64, | |
| "moe_shared_expert_intermediate_size": 128, | |
| "moe_layer_freq": [ | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1 | |
| ], | |
| "moe_router_dtype": "fp32", | |
| "router_act_func": "relu", | |
| "router_norm_type": "simple", | |
| "expert_act_func": "norm_silu", | |
| "expert_act_norm_type": "normal", | |
| "num_layers": 27, | |
| "ffn_hidden_size": 3360, | |
| "num_query_groups": 10, | |
| "norm_epsilon": 1e-05, | |
| "router_norm_fixed": false, | |
| "router_norm_scalar": false, | |
| "router_norm_init_var": 0.1, | |
| "use_blockffn": true, | |
| "router_type": "topk", | |
| "moe_router_enable_expert_bias": false, | |
| "expert_not_gated": true, | |
| "moe_router_pre_softmax": false, | |
| "moe_router_topk": 2, | |
| "moe_router_topp": 0.5, | |
| "moe_router_score_function": "softmax", | |
| "moe_router_topk_scaling_factor": null | |
| } |