Instructions to use RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8") model = AutoModelForCausalLM.from_pretrained("RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8
- SGLang
How to use RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8 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 "RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8" \ --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": "RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8", "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 "RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8" \ --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": "RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8 with Docker Model Runner:
docker model run hf.co/RedHatAI/Mixtral-8x7B-Instruct-v0.1-AutoFP8
Commit History
-
Update README.md
Verified signature18e63e2 -
Update README.md
Verified signature7acc2e8 -
Update README.md
Verified signature9ff1b73
-
Update README.md
Verified signaturec3f8fd4 -
Update README.md
Verified signature710a726
-
Upload model.safetensors.index.json
Verified signaturec9e953c -
Upload model.safetensors.index.json
Verified signaturea7cf313
-
Update README.md
Verified signature54e6f9f -
Update README.md
Verified signature28b8603
-
Update README.md
Verified signatured288bbc -
Update README.md (#1)
Verified signature- Update README.md (32379d5b871f57230a31cd6220eee29b112a4c45) Co-authored-by: Abhinav Agarwalla <abhinavnmagic@users.noreply.huggingface.co>8b22b46
-
Upload folder using huggingface_hub
Verified signature9cf8ac0 -
Upload folder using huggingface_hub
Verified signature3f62150
-
Update README.md
Verified signature09cfe83 -
Update README.md
Verified signature5daf216
-
Update README.md
Verified signatured69cf88 -
Create README.md
Verified signature185a29e -
Upload folder using huggingface_hub
Verified signaturee6ebb47 -
initial commit
Verified signature8f6bca0