Image-Text-to-Text
Transformers
Safetensors
English
qwen3_5
text-generation-inference
quantized
fp8
vllm
coder
9b
agentic
coding
conversational
compressed-tensors
Instructions to use prithivMLmods/OxCoder-9B-fp8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/OxCoder-9B-fp8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="prithivMLmods/OxCoder-9B-fp8") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("prithivMLmods/OxCoder-9B-fp8") model = AutoModelForMultimodalLM.from_pretrained("prithivMLmods/OxCoder-9B-fp8", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prithivMLmods/OxCoder-9B-fp8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/OxCoder-9B-fp8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/OxCoder-9B-fp8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/prithivMLmods/OxCoder-9B-fp8
- SGLang
How to use prithivMLmods/OxCoder-9B-fp8 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 "prithivMLmods/OxCoder-9B-fp8" \ --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": "prithivMLmods/OxCoder-9B-fp8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "prithivMLmods/OxCoder-9B-fp8" \ --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": "prithivMLmods/OxCoder-9B-fp8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use prithivMLmods/OxCoder-9B-fp8 with Docker Model Runner:
docker model run hf.co/prithivMLmods/OxCoder-9B-fp8
Update README.md
Browse files
README.md
CHANGED
|
@@ -17,32 +17,27 @@ pipeline_tag: image-text-to-text
|
|
| 17 |
library_name: transformers
|
| 18 |
---
|
| 19 |
|
| 20 |
-
# **OxCoder-9B-
|
| 21 |
|
| 22 |
-
> This repository contains an FP8 dynamic
|
| 23 |
|
| 24 |
## Model Summary
|
| 25 |
|
| 26 |
-
|
| 27 |
-
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
## Quantization Details
|
| 33 |
|
| 34 |
-
|
| 35 |
-
| :--- | :--- |
|
| 36 |
-
| **Tool / Framework** | `llmcompressor` |
|
| 37 |
-
| **Format** | `compressed-tensors` |
|
| 38 |
-
| **Quantization Scheme** | `FP8_DYNAMIC` |
|
| 39 |
-
| **Target Layers** | `Linear` |
|
| 40 |
-
| **Calibration Required** | No (`requires_calibration_data: false`) |
|
| 41 |
-
| **Excluded Components** | `lm_head`, `embed_tokens`, `visual`, `linear_attn` |
|
| 42 |
-
|
| 43 |
-
Linear layers are dynamically scaled per-tensor during runtime. Sensitive components—such as the language model head, input embedding tables, vision modules, and linear attention projections—remain at full precision to retain fidelity in syntax generation and long-context agentic reasoning.
|
| 44 |
|
| 45 |
-
###
|
| 46 |
|
| 47 |
```yaml
|
| 48 |
default_stage:
|
|
@@ -60,43 +55,59 @@ default_stage:
|
|
| 60 |
requires_calibration_data: false
|
| 61 |
```
|
| 62 |
|
| 63 |
-
|
|
|
|
|
|
|
| 64 |
|
| 65 |
-
##
|
| 66 |
|
| 67 |
-
|
| 68 |
|
| 69 |
-
|
| 70 |
|
| 71 |
```bash
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
```
|
| 78 |
|
| 79 |
-
|
| 80 |
|
| 81 |
```python
|
| 82 |
from vllm import LLM, SamplingParams
|
| 83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
llm = LLM(
|
| 85 |
model="prithivMLmods/OxCoder-9B-fp8",
|
| 86 |
-
|
| 87 |
-
|
| 88 |
)
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
|
|
|
| 92 |
|
| 93 |
-
outputs = llm.generate(
|
| 94 |
-
|
|
|
|
| 95 |
```
|
| 96 |
|
| 97 |
-
### 2.
|
| 98 |
|
| 99 |
-
|
|
|
|
|
|
|
| 100 |
|
| 101 |
```python
|
| 102 |
import torch
|
|
@@ -112,12 +123,22 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 112 |
trust_remote_code=True
|
| 113 |
)
|
| 114 |
|
| 115 |
-
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
-
print(tokenizer.decode(
|
| 119 |
```
|
| 120 |
|
| 121 |
-
## License
|
| 122 |
|
| 123 |
-
|
|
|
|
|
|
| 17 |
library_name: transformers
|
| 18 |
---
|
| 19 |
|
| 20 |
+
# **OxCoder-9B-FP8**
|
| 21 |
|
| 22 |
+
> This repository contains an FP8 dynamic quantized version of **[OrionLLM/OxCoder-9B](https://huggingface.co/OrionLLM/OxCoder-9B)** (built on `Qwen/Qwen3.5-9B`), optimized for high-throughput inference and reduced VRAM footprint using `llm-compressor` and the `compressed-tensors` format. OxCoder-9B is a compact, frontier-class coding and reasoning model tailored for long-horizon agentic workflows, complex terminal operations, multi-file codebases, and interactive software development.
|
| 23 |
|
| 24 |
## Model Summary
|
| 25 |
|
| 26 |
+
| Attribute | Details |
|
| 27 |
+
|---|---|
|
| 28 |
+
| **Base Model** | [OrionLLM/OxCoder-9B](https://huggingface.co/OrionLLM/OxCoder-9B) (Foundation: `Qwen/Qwen3.5-9B`) |
|
| 29 |
+
| **Quantized Model** | `prithivMLmods/OxCoder-9B-fp8` |
|
| 30 |
+
| **Quantization Method** | [LLM Compressor](https://github.com/vllm-project/llm-compressor) |
|
| 31 |
+
| **Quantization Scheme** | `FP8_DYNAMIC` |
|
| 32 |
+
| **Output Format** | `compressed-tensors` |
|
| 33 |
+
| **Native Context Length** | 262,144 tokens (262K) |
|
| 34 |
+
| **License** | Apache-2.0 |
|
| 35 |
|
| 36 |
## Quantization Details
|
| 37 |
|
| 38 |
+
The model was quantized to FP8 using `llm-compressor` with dynamic per-tensor activation scaling. Sensitive architecture components—including the language model head, input embeddings, vision modules, and linear attention layers—were excluded to preserve fidelity, reasoning stability, and code generation precision.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
+
### Quantization Recipe
|
| 41 |
|
| 42 |
```yaml
|
| 43 |
default_stage:
|
|
|
|
| 55 |
requires_calibration_data: false
|
| 56 |
```
|
| 57 |
|
| 58 |
+
* **Targeted Layers:** All standard `Linear` projections (MLP and attention projections).
|
| 59 |
+
* **Excluded Layers:** `lm_head`, `embed_tokens`, `visual`, `model.visual`, and `linear_attn`.
|
| 60 |
+
* **Calibration Required:** No (utilizes runtime dynamic activation scaling).
|
| 61 |
|
| 62 |
+
## Deployment & Inference
|
| 63 |
|
| 64 |
+
### 1. vLLM (Recommended)
|
| 65 |
|
| 66 |
+
`compressed-tensors` FP8 checkpoints run natively in [vLLM](https://github.com/vllm-project/vllm):
|
| 67 |
|
| 68 |
```bash
|
| 69 |
+
pip install vllm
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
Launch an OpenAI-compatible API server:
|
| 73 |
|
| 74 |
+
```bash
|
| 75 |
+
vllm serve prithivMLmods/OxCoder-9B-fp8 \
|
| 76 |
+
--max-model-len 65536 \
|
| 77 |
+
--trust-remote-code
|
| 78 |
```
|
| 79 |
|
| 80 |
+
Or execute via Python:
|
| 81 |
|
| 82 |
```python
|
| 83 |
from vllm import LLM, SamplingParams
|
| 84 |
|
| 85 |
+
sampling_params = SamplingParams(
|
| 86 |
+
temperature=0.6,
|
| 87 |
+
top_p=0.95,
|
| 88 |
+
max_tokens=4096
|
| 89 |
+
)
|
| 90 |
+
|
| 91 |
llm = LLM(
|
| 92 |
model="prithivMLmods/OxCoder-9B-fp8",
|
| 93 |
+
trust_remote_code=True,
|
| 94 |
+
max_model_len=65536
|
| 95 |
)
|
| 96 |
|
| 97 |
+
prompts = [
|
| 98 |
+
"Write a Python script using asyncio to run a rate-limited web scraper with exponential backoff."
|
| 99 |
+
]
|
| 100 |
|
| 101 |
+
outputs = llm.generate(prompts, sampling_params)
|
| 102 |
+
for output in outputs:
|
| 103 |
+
print(output.outputs[0].text)
|
| 104 |
```
|
| 105 |
|
| 106 |
+
### 2. Transformers & Compressed Tensors
|
| 107 |
|
| 108 |
+
```bash
|
| 109 |
+
pip install transformers compressed-tensors accelerate
|
| 110 |
+
```
|
| 111 |
|
| 112 |
```python
|
| 113 |
import torch
|
|
|
|
| 123 |
trust_remote_code=True
|
| 124 |
)
|
| 125 |
|
| 126 |
+
prompt = "Implement a LRU cache with O(1) runtime for get and put operations in Python."
|
| 127 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 128 |
+
|
| 129 |
+
with torch.no_grad():
|
| 130 |
+
output_tokens = model.generate(
|
| 131 |
+
**inputs,
|
| 132 |
+
max_new_tokens=1024,
|
| 133 |
+
temperature=0.6,
|
| 134 |
+
top_p=0.95,
|
| 135 |
+
do_sample=True
|
| 136 |
+
)
|
| 137 |
|
| 138 |
+
print(tokenizer.decode(output_tokens[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
|
| 139 |
```
|
| 140 |
|
| 141 |
+
## Attribution & License
|
| 142 |
|
| 143 |
+
* **Base Architecture & Weights:** Developed by [OrionLLM](https://huggingface.co/OrionLLM) based on `Qwen/Qwen3.5-9B`.
|
| 144 |
+
* **License:** Released under the [Apache 2.0 License](https://www.google.com/search?q=LICENSE).
|