Text Generation
Transformers
Safetensors
phi3
quantized
compressed-tensors
gptq
w4a16
vllm
ampere
conversational
text-generation-inference
Instructions to use aleada/Phi-4-W4A16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aleada/Phi-4-W4A16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aleada/Phi-4-W4A16") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aleada/Phi-4-W4A16") model = AutoModelForCausalLM.from_pretrained("aleada/Phi-4-W4A16", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aleada/Phi-4-W4A16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aleada/Phi-4-W4A16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aleada/Phi-4-W4A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/aleada/Phi-4-W4A16
- SGLang
How to use aleada/Phi-4-W4A16 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 "aleada/Phi-4-W4A16" \ --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": "aleada/Phi-4-W4A16", "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 "aleada/Phi-4-W4A16" \ --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": "aleada/Phi-4-W4A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use aleada/Phi-4-W4A16 with Docker Model Runner:
docker model run hf.co/aleada/Phi-4-W4A16
add a link to the pack integrity checker
Browse filesIt reads any published pack's metadata and reports whether its
exclusion entries name real modules, whether anything from the source
failed to reach it, and whether anything is left at source precision
without being declared. Inserted rather than regenerated: six of these
cards predate the sidecar that records calibration settings, and
regenerating them would replace real values with em dashes.
README.md
CHANGED
|
@@ -97,6 +97,23 @@ checkpoints are native on Hopper and Blackwell but emulated or
|
|
| 97 |
unusable on Ampere, where the INT4 Marlin kernels are what actually
|
| 98 |
run fast.
|
| 99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
## About the maintainer
|
| 101 |
|
| 102 |
Alex Adamopoulos is the founder of [assert.gr](https://assert.gr) and
|
|
|
|
| 97 |
unusable on Ampere, where the INT4 Marlin kernels are what actually
|
| 98 |
run fast.
|
| 99 |
|
| 100 |
+
## Check this pack yourself
|
| 101 |
+
|
| 102 |
+
Quantization can drop or disable part of a model without failing: the
|
| 103 |
+
pack loads, serves, and answers correctly while something its card
|
| 104 |
+
says it kept is absent, or present and ignored by the runtime. Nothing
|
| 105 |
+
errors, and the card still promises it.
|
| 106 |
+
|
| 107 |
+
**[Pack integrity check](https://huggingface.co/spaces/aleada/pack-integrity-check)**
|
| 108 |
+
reads any published repo's metadata — safetensors headers and
|
| 109 |
+
`config.json`, no weights — and reports whether its exclusion entries
|
| 110 |
+
name real modules, whether anything from the source model failed to
|
| 111 |
+
reach it, and whether anything is left at source precision without
|
| 112 |
+
being declared. It runs entirely in your browser, so it reads exactly
|
| 113 |
+
what you could read yourself.
|
| 114 |
+
|
| 115 |
+
Point it at this pack. Point it at someone else's.
|
| 116 |
+
|
| 117 |
## About the maintainer
|
| 118 |
|
| 119 |
Alex Adamopoulos is the founder of [assert.gr](https://assert.gr) and
|