Instructions to use danieldk/Phi-3.5-MoE-instruct-AWQ-INT4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use danieldk/Phi-3.5-MoE-instruct-AWQ-INT4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="danieldk/Phi-3.5-MoE-instruct-AWQ-INT4", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("danieldk/Phi-3.5-MoE-instruct-AWQ-INT4", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("danieldk/Phi-3.5-MoE-instruct-AWQ-INT4", trust_remote_code=True) 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
- vLLM
How to use danieldk/Phi-3.5-MoE-instruct-AWQ-INT4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "danieldk/Phi-3.5-MoE-instruct-AWQ-INT4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "danieldk/Phi-3.5-MoE-instruct-AWQ-INT4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/danieldk/Phi-3.5-MoE-instruct-AWQ-INT4
- SGLang
How to use danieldk/Phi-3.5-MoE-instruct-AWQ-INT4 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 "danieldk/Phi-3.5-MoE-instruct-AWQ-INT4" \ --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": "danieldk/Phi-3.5-MoE-instruct-AWQ-INT4", "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 "danieldk/Phi-3.5-MoE-instruct-AWQ-INT4" \ --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": "danieldk/Phi-3.5-MoE-instruct-AWQ-INT4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use danieldk/Phi-3.5-MoE-instruct-AWQ-INT4 with Docker Model Runner:
docker model run hf.co/danieldk/Phi-3.5-MoE-instruct-AWQ-INT4
This repository is a quantized version of the original model
microsoft/Phi-3.5-MoE-instructwhich is the FP16 half-precision official version released by Microsoft.
Model Summary
Phi-3.5-MoE is a lightweight, state-of-the-art open model built upon datasets used for Phi-3 - synthetic data and filtered publicly available documents - with a focus on very high-quality, reasoning dense data. The model supports multilingual and comes with 128K context length (in tokens). The model underwent a rigorous enhancement process, incorporating supervised fine-tuning, proximal policy optimization, and direct preference optimization to ensure precise instruction adherence and robust safety measures.
🏡 Phi-3 Portal
📰 Phi-3 Microsoft Blog
📖 Phi-3 Technical Report
👩🍳 Phi-3 Cookbook
🖥️ Try It
MoE references: 📜Phi-3.5-MoE Blog | 😁GRIN MoE
Phi-3.5: [mini-instruct]; [MoE-instruct] ; [vision-instruct]
Running 🏃
TGI
model=danieldk/Phi-3.5-MoE-instruct-AWQ-INT4
volume=$PWD/data # share a volume with the Docker container to avoid downloading weights every run
docker run --gpus all --shm-size 1g -p 8080:80 -v $volume:/data \
ghcr.io/huggingface/text-generation-inference:2.4.0 \
--model-id $model --num-shard 2
Quantization Reproduction
Soon (need to upstream an AutoAWQ patch).
- Downloads last month
- 111