Instructions to use mtaku3/XtraGPT-14B-W4A16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mtaku3/XtraGPT-14B-W4A16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mtaku3/XtraGPT-14B-W4A16", 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("mtaku3/XtraGPT-14B-W4A16", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("mtaku3/XtraGPT-14B-W4A16", 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 mtaku3/XtraGPT-14B-W4A16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mtaku3/XtraGPT-14B-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": "mtaku3/XtraGPT-14B-W4A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mtaku3/XtraGPT-14B-W4A16
- SGLang
How to use mtaku3/XtraGPT-14B-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 "mtaku3/XtraGPT-14B-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": "mtaku3/XtraGPT-14B-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 "mtaku3/XtraGPT-14B-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": "mtaku3/XtraGPT-14B-W4A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mtaku3/XtraGPT-14B-W4A16 with Docker Model Runner:
docker model run hf.co/mtaku3/XtraGPT-14B-W4A16
XtraGPT-14B-W4A16
This is an AWQ W4A16 quantization of Xtra-Computing/XtraGPT-14B. It is intended for context-aware academic-paper revision and preserves the original tokenizer and chat template.
Quantization
- Algorithm: Activation-aware Weight Quantization (AWQ)
- Format:
compressed-tensors - Weights: asymmetric INT4
- Activations: 16-bit
- Group size: 128
- Quantized modules:
Linear, excludinglm_head - Calibration: 128 samples from Xtra-Computing/ReviseQA, maximum sequence length 2048
- Source revision:
01dd781fea28a43bb36a0d297ee8181e849fb10c - Calibration dataset revision:
4826925f33d825be0d54ca7c5618c032d55ea337
The calibration inputs keep both the beginning of each paper prompt and the final revision question/answer when a sample exceeds the sequence limit.
Usage with vLLM
vllm serve REPO_ID \
--served-model-name xtragpt \
--max-model-len 16384 \
--gpu-memory-utilization 0.95
Use the <PAPER_CONTENT>, <SELECTED_CONTENT>, and <QUESTION> prompt tags shown
in the base model card.
Build environment
torch==2.13.0transformers==5.14.1llmcompressor==0.13.0compressed-tensors==0.18.0datasets==5.0.1huggingface-hub==1.28.0
Evaluation
A short generation smoke test was run during quantization unless explicitly disabled. No benchmark result is claimed here; compare the quantized checkpoint with the BF16 source on a held-out ReviseQA subset before production use.
License and attribution
The source model is released under the ModelGo Zero License 2.0 (MG0-2.0). See the base model card and license text.
- Downloads last month
- -