Instructions to use Crystalcareai/GemMoE-Beta-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Crystalcareai/GemMoE-Beta-1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Crystalcareai/GemMoE-Beta-1", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Crystalcareai/GemMoE-Beta-1", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Crystalcareai/GemMoE-Beta-1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Crystalcareai/GemMoE-Beta-1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Crystalcareai/GemMoE-Beta-1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Crystalcareai/GemMoE-Beta-1
- SGLang
How to use Crystalcareai/GemMoE-Beta-1 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 "Crystalcareai/GemMoE-Beta-1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Crystalcareai/GemMoE-Beta-1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Crystalcareai/GemMoE-Beta-1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Crystalcareai/GemMoE-Beta-1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Crystalcareai/GemMoE-Beta-1 with Docker Model Runner:
docker model run hf.co/Crystalcareai/GemMoE-Beta-1
Memory requirement
Hello, I’m trying to load the model in my server with 4 A4500 with 20G memory each, but always get oom error.
What’s the suggested memory requirement?
Hey are trying to load it for training or inference? The model itself is ~96GB. Loading in 4 bit works for inference on a single a a6000 card. I'm going to be pushing an update to the modeling_gemmoe file here in a couple of hours and that should make things a bit more stable.
Hey are trying to load it for training or inference? The model itself is ~96GB. Loading in 4 bit works for inference on a single a a6000 card. I'm going to be pushing an update to the modeling_gemmoe file here in a couple of hours and that should make things a bit more stable.
I see. Could you also give us the sample code of loading model correctly?
Yeah I'm currently writing up a whole document with all the code/info. Will be out by this evening.