Instructions to use 4iqq/phi-3-mini-instruct-128K-APPS-F16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 4iqq/phi-3-mini-instruct-128K-APPS-F16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="4iqq/phi-3-mini-instruct-128K-APPS-F16", 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("4iqq/phi-3-mini-instruct-128K-APPS-F16", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("4iqq/phi-3-mini-instruct-128K-APPS-F16", 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 4iqq/phi-3-mini-instruct-128K-APPS-F16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "4iqq/phi-3-mini-instruct-128K-APPS-F16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "4iqq/phi-3-mini-instruct-128K-APPS-F16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/4iqq/phi-3-mini-instruct-128K-APPS-F16
- SGLang
How to use 4iqq/phi-3-mini-instruct-128K-APPS-F16 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 "4iqq/phi-3-mini-instruct-128K-APPS-F16" \ --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": "4iqq/phi-3-mini-instruct-128K-APPS-F16", "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 "4iqq/phi-3-mini-instruct-128K-APPS-F16" \ --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": "4iqq/phi-3-mini-instruct-128K-APPS-F16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use 4iqq/phi-3-mini-instruct-128K-APPS-F16 with Docker Model Runner:
docker model run hf.co/4iqq/phi-3-mini-instruct-128K-APPS-F16
# phi-3-mini-instruct-128K-APPS-F16
Fine-tuned Phi-3-mini-128K-instruct model specialized for reasoning and coding tasks.
## 🚀 Model Details
- **Base Model**: [microsoft/Phi-3-mini-128k-instruct](https://huggingface.co/microsoft/Phi-3-mini-128k-instruct)
- **Adapter Used**: [AdnanRiaz107/CodePhi-3-mini-128k-instruct-APPS](https://huggingface.co/AdnanRiaz107/CodePhi-3-mini-128k-instruct-APPS)
- **Architecture**: Transformer-based language model
- **Context Length**: 128K tokens
- **Specialization**: Enhanced for complex reasoning and programming tasks
## 📊 Base Model Specifications
For complete technical specifications, hardware requirements, and performance characteristics, please refer to the official base model repository:
**[microsoft/Phi-3-mini-128k-instruct](https://huggingface.co/microsoft/Phi-3-mini-128k-instruct)**
## 🛠️ Training Approach
This model was created by applying the **CodePhi-3-mini-128k-instruct-APPS** adapter to the base Phi-3 model, further optimized for coding and reasoning tasks while maintaining the original 128K context window.
## 🔧 Usage
### Direct Inference
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"4iqq/phi-3-mini-instruct-128K-APPS-F16",
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
"4iqq/phi-3-mini-instruct-128K-APPS-F16",
trust_remote_code=True
)
Convert to GGUF
python convert-hf-to-gguf.py 4iqq/phi-3-mini-instruct-128K-APPS-F16 --outtype f16
Further Fine-tuning
from peft import PeftModel, PeftConfig
model = PeftModel.from_pretrained(
"microsoft/Phi-3-mini-128k-instruct",
"4iqq/phi-3-mini-instruct-128K-APPS-F16"
)
📁 Repository Structure
This repository contains:
· Sharded model weights (model-0000x-of-0000x.safetensors) · Complete tokenizer files · Model configuration · Training adapters for further fine-tuning
🙏 Acknowledgments
· Microsoft for the base Phi-3-mini-128k-instruct model · AdnanRiaz107 for the original CodePhi-3 adapter
⚠️ Note
Model weights are provided in sharded format to support both:
· Direct GGUF conversion · Additional fine-tuning · Flexible deployment options
📄 License
Inherited from the base model - refer to microsoft/Phi-3-mini-128k-instruct for license details.
- Downloads last month
- 2
Model tree for 4iqq/phi-3-mini-instruct-128K-APPS-F16
Base model
microsoft/Phi-3-mini-128k-instruct