Text Generation
Transformers
Safetensors
English
Korean
Motif
feature-extraction
motif
motif-3
mixture-of-experts
Mixture of Experts
multilingual
conversational
custom_code
Instructions to use Motif-Technologies/Motif-3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Motif-Technologies/Motif-3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Motif-Technologies/Motif-3", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Motif-Technologies/Motif-3", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Motif-Technologies/Motif-3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Motif-Technologies/Motif-3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Motif-Technologies/Motif-3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Motif-Technologies/Motif-3
- SGLang
How to use Motif-Technologies/Motif-3 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 "Motif-Technologies/Motif-3" \ --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": "Motif-Technologies/Motif-3", "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 "Motif-Technologies/Motif-3" \ --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": "Motif-Technologies/Motif-3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Motif-Technologies/Motif-3 with Docker Model Runner:
docker model run hf.co/Motif-Technologies/Motif-3
| { | |
| "_debug_force_load_balance": false, | |
| "architectures": [ | |
| "MotifForCausalLM" | |
| ], | |
| "attention_cls": "gdla", | |
| "attention_dropout": 0.0, | |
| "auto_map": { | |
| "AutoConfig": "configuration_motif.MotifConfig", | |
| "AutoModel": "modeling_motif.MotifForCausalLM", | |
| "AutoModelForCausalLM": "modeling_motif.MotifForCausalLM" | |
| }, | |
| "diff_v2": true, | |
| "dtype": "bfloat16", | |
| "elementwise_attn_output_gate": true, | |
| "eos_token_id": 0, | |
| "experts_top_k": 8, | |
| "head_dim": 192, | |
| "headwise_attn_output_gate": false, | |
| "hidden_act": "poly_norm", | |
| "hidden_size": 4096, | |
| "initializer_range": 0.02, | |
| "interleave_moe_layer_step": 1, | |
| "intermediate_size": 12288, | |
| "k_ratio": 1, | |
| "kv_lora_rank": 512, | |
| "load_balance_coeff": 0.0001, | |
| "max_position_embeddings": 262144, | |
| "max_window_layers": 9, | |
| "mhc_enabled": true, | |
| "mhc_expansion_rate": 4, | |
| "mhc_identity_init": false, | |
| "mhc_sinkhorn_iters": 20, | |
| "model_type": "Motif", | |
| "moe_intermediate_size": 1280, | |
| "mscale": 1.0, | |
| "n_dense_first_layers": 2, | |
| "num_attention_heads": 80, | |
| "num_experts": 384, | |
| "num_hidden_layers": 53, | |
| "num_key_value_heads": 16, | |
| "num_noise_heads": 16, | |
| "num_shared_experts": 1, | |
| "output_router_logits": false, | |
| "q_lora_rank": 1024, | |
| "qk_rope_head_dim": 64, | |
| "rms_norm_eps": 1e-05, | |
| "rope_theta": 10000.0, | |
| "route_norm": true, | |
| "route_scale": 2.0, | |
| "router_aux_loss_coef": 0.0, | |
| "score_before_experts": false, | |
| "score_func": "sigmoid", | |
| "sliding_window": 128, | |
| "sliding_window_pattern": "interleave", | |
| "sliding_window_period": 4, | |
| "swa_rope_theta": 10000.0, | |
| "tie_word_embeddings": false, | |
| "transformers_version": "5.7.0", | |
| "use_cache": true, | |
| "use_sliding_window": true, | |
| "v_head_dim": 128, | |
| "vocab_size": 220160, | |
| "rope_factor": 64.0, | |
| "original_seq_len": 4096, | |
| "rope_scaling": { | |
| "original_max_position_embeddings": 4096, | |
| "factor": 64.0, | |
| "mscale": 1.0, | |
| "rope_type": "yarn", | |
| "rope_theta": 10000.0, | |
| "beta_fast": 32.0, | |
| "beta_slow": 1.0, | |
| "apply_yarn_scaling": false | |
| }, | |
| "polynorm_output_scale": 0.5, | |
| "polynorm_output_scale_per_layer": {}, | |
| "polynorm_bias_clamp": 0.5, | |
| "hidden_clamp": 1000000.0, | |
| "num_nextn_predict_layers": 1 | |
| } |