Instructions to use BeardedMonster/MOE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BeardedMonster/MOE with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BeardedMonster/MOE", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("BeardedMonster/MOE", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BeardedMonster/MOE with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BeardedMonster/MOE" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BeardedMonster/MOE", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BeardedMonster/MOE
- SGLang
How to use BeardedMonster/MOE 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 "BeardedMonster/MOE" \ --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": "BeardedMonster/MOE", "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 "BeardedMonster/MOE" \ --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": "BeardedMonster/MOE", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use BeardedMonster/MOE with Docker Model Runner:
docker model run hf.co/BeardedMonster/MOE
| { | |
| "_name_or_path": "BeardedMonster/MOE", | |
| "architectures": [ | |
| "GPTJXMoEForCausalLM" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration.GPTJXMoEConfig", | |
| "AutoModelForCausalLM": "modeling.GPTJXMoEForCausalLM" | |
| }, | |
| "bias": false, | |
| "block_size": 32768, | |
| "dropout": 0.0, | |
| "kv_cache_dtype": "float32", | |
| "max_batch_size": 1, | |
| "model_type": "sabiyarn", | |
| "moe_dim": 3072, | |
| "n_embd": 768, | |
| "n_heads": 12, | |
| "n_layer": 12, | |
| "num_experts": 7, | |
| "num_experts_per_tok": 2, | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.41.2", | |
| "use_kv_cache": true, | |
| "use_moe": true, | |
| "vocab_size": 52050 | |
| } | |