File size: 4,261 Bytes
9144e5d
 
8477694
 
7eee18c
 
513db25
 
 
7eee18c
 
 
 
 
 
 
 
513db25
 
83d0912
513db25
83d0912
513db25
 
 
83d0912
 
 
 
 
 
 
 
 
513db25
 
 
83d0912
513db25
83d0912
513db25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83d0912
 
 
513db25
83d0912
513db25
83d0912
513db25
83d0912
513db25
 
83d0912
 
 
 
513db25
83d0912
 
 
 
513db25
 
83d0912
513db25
 
 
 
83d0912
 
 
 
 
 
513db25
 
83d0912
 
513db25
 
83d0912
 
 
513db25
83d0912
 
 
513db25
 
83d0912
513db25
83d0912
 
 
513db25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83d0912
 
 
 
 
 
 
 
 
 
 
513db25
83d0912
513db25
 
83d0912
513db25
83d0912
9f34576
83d0912
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
license: apache-2.0
base_model:
- OrionLLM/OxCoder-9B
tags:
- text-generation-inference
- quantized
- fp8
- vllm
- coder
- 9b
- agentic
- coding
language:
- en
pipeline_tag: image-text-to-text
library_name: transformers
---

# **OxCoder-9B-FP8**

> 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.

## Model Summary

| Attribute | Details |
|---|---|
| **Base Model** | [OrionLLM/OxCoder-9B](https://huggingface.co/OrionLLM/OxCoder-9B) (Foundation: `Qwen/Qwen3.5-9B`) |
| **Quantized Model** | `prithivMLmods/OxCoder-9B-fp8` |
| **Quantization Method** | [LLM Compressor](https://github.com/vllm-project/llm-compressor) |
| **Quantization Scheme** | `FP8_DYNAMIC` |
| **Output Format** | `compressed-tensors` |
| **Native Context Length** | 262,144 tokens (262K) |
| **License** | Apache-2.0 |

## Quantization Details

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.

### Quantization Recipe

```yaml
default_stage:
  default_modifiers:
    QuantizationModifier:
      targets: [Linear]
      ignore:
        - 're:.*lm_head'
        - 're:.*embed_tokens$'
        - 're:.*visual.*'
        - 're:.*model.visual.*'
        - 're:.*linear_attn.*'
      scheme: FP8_DYNAMIC
      bypass_divisibility_checks: false
      requires_calibration_data: false
```

* **Targeted Layers:** All standard `Linear` projections (MLP and attention projections).
* **Excluded Layers:** `lm_head`, `embed_tokens`, `visual`, `model.visual`, and `linear_attn`.
* **Calibration Required:** No (utilizes runtime dynamic activation scaling).

## Deployment & Inference

### 1. vLLM (Recommended)

`compressed-tensors` FP8 checkpoints run natively in [vLLM](https://github.com/vllm-project/vllm):

```bash
pip install vllm
```

Launch an OpenAI-compatible API server:

```bash
vllm serve prithivMLmods/OxCoder-9B-fp8 \
    --max-model-len 65536 \
    --trust-remote-code
```

Or execute via Python:

```python
from vllm import LLM, SamplingParams

sampling_params = SamplingParams(
    temperature=0.6,
    top_p=0.95,
    max_tokens=4096
)

llm = LLM(
    model="prithivMLmods/OxCoder-9B-fp8",
    trust_remote_code=True,
    max_model_len=65536
)

prompts = [
    "Write a Python script using asyncio to run a rate-limited web scraper with exponential backoff."
]

outputs = llm.generate(prompts, sampling_params)
for output in outputs:
    print(output.outputs[0].text)
```

### 2. Transformers & Compressed Tensors

```bash
pip install transformers compressed-tensors accelerate
```

```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "prithivMLmods/OxCoder-9B-fp8"

tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    device_map="auto",
    torch_dtype="auto",
    trust_remote_code=True
)

prompt = "Implement a LRU cache with O(1) runtime for get and put operations in Python."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

with torch.no_grad():
    output_tokens = model.generate(
        **inputs,
        max_new_tokens=1024,
        temperature=0.6,
        top_p=0.95,
        do_sample=True
    )

print(tokenizer.decode(output_tokens[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
```

## Attribution & License

* **Base Architecture & Weights:** Developed by [OrionLLM](https://huggingface.co/OrionLLM) based on `Qwen/Qwen3.5-9B`.
* **Quantization:** Prepared and hosted by `prithivMLmods`.
* **License:** Released under the [Apache 2.0 License](https://www.google.com/search?q=LICENSE).