Text Generation
Transformers
Safetensors
qwen4_exp_text
qwen4-exp
mixture-of-experts
language-model
pretrained
conversational
Instructions to use Modujo-AI/ModujoMoE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Modujo-AI/ModujoMoE with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Modujo-AI/ModujoMoE") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Modujo-AI/ModujoMoE") model = AutoModelForCausalLM.from_pretrained("Modujo-AI/ModujoMoE", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Modujo-AI/ModujoMoE with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Modujo-AI/ModujoMoE" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Modujo-AI/ModujoMoE", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Modujo-AI/ModujoMoE
- SGLang
How to use Modujo-AI/ModujoMoE 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 "Modujo-AI/ModujoMoE" \ --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": "Modujo-AI/ModujoMoE", "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 "Modujo-AI/ModujoMoE" \ --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": "Modujo-AI/ModujoMoE", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Modujo-AI/ModujoMoE with Docker Model Runner:
docker model run hf.co/Modujo-AI/ModujoMoE
| { | |
| "architectures": [ | |
| "Qwen4ExpForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "bos_token_id": 248044, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 248044, | |
| "hc_count": 4, | |
| "hc_lowrank": 192, | |
| "head_dim": 128, | |
| "heads_per_ngram": 8, | |
| "hidden_act": "silu", | |
| "hidden_size": 1536, | |
| "indexer_budget": 1024, | |
| "indexer_compress_ratio": 4, | |
| "indexer_head_dim": 64, | |
| "indexer_kv_heads": 1, | |
| "indexer_n_heads": 4, | |
| "initializer_range": 0.02, | |
| "layer_types": [ | |
| "linear_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "qwen_sparse_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "qwen_sparse_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "qwen_sparse_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "qwen_sparse_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "qwen_sparse_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "qwen_sparse_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "qwen_sparse_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "qwen_sparse_attention" | |
| ], | |
| "linear_conv_kernel_dim": 4, | |
| "linear_key_head_dim": 128, | |
| "linear_num_key_heads": 8, | |
| "linear_num_value_heads": 24, | |
| "linear_value_head_dim": 128, | |
| "make_ngram_vocab_size_divisible_by": 128, | |
| "max_position_embeddings": 32768, | |
| "model_type": "qwen4_exp_text", | |
| "moe_intermediate_size": 768, | |
| "ngram_size": 3, | |
| "ngram_vocab_size_base": 144128, | |
| "norm_topk_prob": true, | |
| "num_attention_heads": 12, | |
| "num_experts": 64, | |
| "num_experts_per_tok": 2, | |
| "num_hidden_layers": 32, | |
| "num_key_value_heads": 2, | |
| "number_of_conv_states": 3, | |
| "output_gate_type": "sigmoid", | |
| "output_router_logits": false, | |
| "pad_token_id": 248044, | |
| "ple_conv_kernel_size": 4, | |
| "ple_embed_dim": 1536, | |
| "ple_layer_ids": [ | |
| 2 | |
| ], | |
| "rms_norm_eps": 1e-06, | |
| "rope_parameters": { | |
| "partial_rotary_factor": 0.25, | |
| "rope_theta": 10000000, | |
| "rope_type": "default" | |
| }, | |
| "router_aux_loss_coef": 0.001, | |
| "seed": 1234, | |
| "shared_expert_intermediate_size": 768, | |
| "split_ngram_parts": 128, | |
| "tie_word_embeddings": false, | |
| "transformers_version": "5.17.0", | |
| "use_cache": true, | |
| "vocab_size": 248320 | |
| } | |