Instructions to use chris320211/flatquant-phi3-mini-4k-g52xlarge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chris320211/flatquant-phi3-mini-4k-g52xlarge with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="chris320211/flatquant-phi3-mini-4k-g52xlarge", 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("chris320211/flatquant-phi3-mini-4k-g52xlarge", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("chris320211/flatquant-phi3-mini-4k-g52xlarge", trust_remote_code=True, 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 chris320211/flatquant-phi3-mini-4k-g52xlarge with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "chris320211/flatquant-phi3-mini-4k-g52xlarge" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chris320211/flatquant-phi3-mini-4k-g52xlarge", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/chris320211/flatquant-phi3-mini-4k-g52xlarge
- SGLang
How to use chris320211/flatquant-phi3-mini-4k-g52xlarge 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 "chris320211/flatquant-phi3-mini-4k-g52xlarge" \ --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": "chris320211/flatquant-phi3-mini-4k-g52xlarge", "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 "chris320211/flatquant-phi3-mini-4k-g52xlarge" \ --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": "chris320211/flatquant-phi3-mini-4k-g52xlarge", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use chris320211/flatquant-phi3-mini-4k-g52xlarge with Docker Model Runner:
docker model run hf.co/chris320211/flatquant-phi3-mini-4k-g52xlarge
FlatQuant microsoft/Phi-3-mini-4k-instruct
Quantized derivative of microsoft/Phi-3-mini-4k-instruct.
Not Hub fp16. Weights are the packed/runtime artifact from job 20260919T202736Z-5a1860.
WikiText-2 (test, 2048-token windows, 65504 tokens)
Measured on NVIDIA A10G (g5.2xlarge) against the original fp16 snapshot.
Numbers copied from jobs/20260919T202736Z-5a1860/benchmark.json.
| Quantized | fp16 snapshot | |
|---|---|---|
| Perplexity | 7.393646 | 6.332276 |
| NLL loss | 2.000621 | 1.845660 |
| Tokens/s (2048 prefill, after warmup) | 5105.9 | 3387.6 |
| Peak VRAM (GB) | 3.355 | 9.681 |
ppl_ratio: 1.167613 (quality_ok=True)improved_throughput: Trueimproved_vram: True
Pull
from huggingface_hub import snapshot_download
path = snapshot_download("chris320211/flatquant-phi3-mini-4k-g52xlarge")
This is not a drop-in AutoModelForCausalLM.from_pretrained checkpoint.
Reload with the included quant_agent_inference_adapter.py after the method
repo (and overlay, if any) is on QUANT_AGENT_METHOD_REPO. See
quantization_config.json.
License
Base model license (MIT for Phi-3) plus the method repository license.
Keep LICENSE / NOTICE.md from the snapshot when present.
- Downloads last month
- 396
Model tree for chris320211/flatquant-phi3-mini-4k-g52xlarge
Base model
microsoft/Phi-3-mini-4k-instruct