Instructions to use llmware/phi-3-ov with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use llmware/phi-3-ov with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="llmware/phi-3-ov", 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("llmware/phi-3-ov", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("llmware/phi-3-ov", 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 Settings
- vLLM
How to use llmware/phi-3-ov with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "llmware/phi-3-ov" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "llmware/phi-3-ov", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/llmware/phi-3-ov
- SGLang
How to use llmware/phi-3-ov 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 "llmware/phi-3-ov" \ --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": "llmware/phi-3-ov", "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 "llmware/phi-3-ov" \ --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": "llmware/phi-3-ov", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use llmware/phi-3-ov with Docker Model Runner:
docker model run hf.co/llmware/phi-3-ov
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,26 +8,24 @@ tags: [green, llmware-chat, p3, ov]
|
|
| 8 |
|
| 9 |
<!-- Provide a quick summary of what the model is/does. -->
|
| 10 |
|
| 11 |
-
**phi-3-ov** is an OpenVino int4 quantized version of Microsoft Phi-3-mini-4k-instruct, providing a very fast, very small inference implementation, optimized for AI PCs using Intel GPU, CPU and NPU.
|
| 12 |
-
|
| 13 |
-
[**phi-3-mini**](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct) is a fact-based question-answering model, optimized for complex business documents.
|
| 14 |
-
|
| 15 |
-
Get started right away with [OpenVino](https://github.com/openvinotoolkit/openvino)
|
| 16 |
-
|
| 17 |
-
Looking for AI PC solutions and demos, contact us at [llmware](https://www.llmware.ai)
|
| 18 |
|
| 19 |
|
| 20 |
### Model Description
|
| 21 |
|
| 22 |
-
- **Developed by:**
|
| 23 |
- **Model type:** phi3
|
| 24 |
-
- **Parameters:** 3.8 billion
|
| 25 |
- **Model Parent:** microsoft/Phi-3-mini-4k-instruct
|
| 26 |
- **Language(s) (NLP):** English
|
| 27 |
- **License:** Apache 2.0
|
| 28 |
-
- **Uses:** Chat, general-purpose LLM
|
| 29 |
- **Quantization:** int4
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
## Model Card Contact
|
| 33 |
|
|
|
|
| 8 |
|
| 9 |
<!-- Provide a quick summary of what the model is/does. -->
|
| 10 |
|
| 11 |
+
**phi-3-ov** is an OpenVino int4 quantized version of [Microsoft Phi-3-mini-4k-instruct](https://www.huggingface.co/microsoft/Phi-3-mini-4k-instruct), providing a very fast, very small inference implementation, optimized for AI PCs using Intel GPU, CPU and NPU.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
### Model Description
|
| 15 |
|
| 16 |
+
- **Developed by:** microsoft
|
| 17 |
- **Model type:** phi3
|
| 18 |
+
- **Parameters:** 3.8 billion
|
| 19 |
- **Model Parent:** microsoft/Phi-3-mini-4k-instruct
|
| 20 |
- **Language(s) (NLP):** English
|
| 21 |
- **License:** Apache 2.0
|
| 22 |
+
- **Uses:** Chat, general-purpose LLM
|
| 23 |
- **Quantization:** int4
|
| 24 |
|
| 25 |
+
Get started right away with [OpenVino](https://github.com/openvinotoolkit/openvino)
|
| 26 |
+
|
| 27 |
+
Looking for AI PC solutions and demos, contact us at [llmware](https://www.llmware.ai)
|
| 28 |
+
|
| 29 |
|
| 30 |
## Model Card Contact
|
| 31 |
|