Text Generation
Transformers
English
multilingual
phi3
phi
phi-4
microsoft
causal-lm
enhanced
optimized
lightweight
efficient
custom_code
Instructions to use gulf-inference/phi-4-mini-enhanced with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gulf-inference/phi-4-mini-enhanced with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gulf-inference/phi-4-mini-enhanced", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("gulf-inference/phi-4-mini-enhanced", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("gulf-inference/phi-4-mini-enhanced", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gulf-inference/phi-4-mini-enhanced with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gulf-inference/phi-4-mini-enhanced" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gulf-inference/phi-4-mini-enhanced", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/gulf-inference/phi-4-mini-enhanced
- SGLang
How to use gulf-inference/phi-4-mini-enhanced 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 "gulf-inference/phi-4-mini-enhanced" \ --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": "gulf-inference/phi-4-mini-enhanced", "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 "gulf-inference/phi-4-mini-enhanced" \ --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": "gulf-inference/phi-4-mini-enhanced", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use gulf-inference/phi-4-mini-enhanced with Docker Model Runner:
docker model run hf.co/gulf-inference/phi-4-mini-enhanced
| tags: | |
| - phi | |
| - phi-4 | |
| - microsoft | |
| - causal-lm | |
| - text-generation | |
| - enhanced | |
| - optimized | |
| - lightweight | |
| - efficient | |
| - transformers | |
| license: mit | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| language: | |
| - en | |
| - multilingual | |
| # Phi-4 Mini Enhanced | |
| > Enhanced version of Microsoft Phi-4-mini-instruct with optimized inference and extended context support. | |
| ## Quick Start | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model = AutoModelForCausalLM.from_pretrained( | |
| "gulf-inference/phi-4-mini-enhanced", | |
| trust_remote_code=True, | |
| torch_dtype="auto" | |
| ) | |
| tokenizer = AutoTokenizer.from_pretrained("gulf-inference/phi-4-mini-enhanced") | |
| ``` | |
| ## Key Improvements | |
| - Faster inference: optimized attention | |
| - Extended context: up to 8K tokens | |
| - Drop-in replacement — same API, better performance | |
| ## License | |
| MIT | |