prithivMLmods commited on
Commit
83d0912
·
verified ·
1 Parent(s): 513db25

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +61 -40
README.md CHANGED
@@ -17,32 +17,27 @@ pipeline_tag: image-text-to-text
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 agentic coding workflows using **vLLM** and **compressed-tensors**. Quantization was executed using [llm-compressor](https://github.com/vllm-project/llm-compressor) targeting linear projection layers while preserving critical token embeddings, heads, and specialized layers at full precision.
23
 
24
  ## Model Summary
25
 
26
- - **Base Model:** [OrionLLM/OxCoder-9B](https://huggingface.co/OrionLLM/OxCoder-9B)
27
- - **Foundational Architecture:** Qwen/Qwen3.5-9B
28
- - **Quantization Format:** `compressed-tensors` (FP8_DYNAMIC)
29
- - **Context Window:** 262,144 tokens (262K native)
30
- - **Primary Use Cases:** Agentic coding, multi-file codebase reasoning, terminal tool execution, and frontend code generation
 
 
 
 
31
 
32
  ## Quantization Details
33
 
34
- | Property | Specification |
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
- ### Recipe Used
46
 
47
  ```yaml
48
  default_stage:
@@ -60,43 +55,59 @@ default_stage:
60
  requires_calibration_data: false
61
  ```
62
 
63
- ## Quickstart & Deployment
 
 
64
 
65
- ### 1. High-Throughput Serving with vLLM
66
 
67
- The recommended engine for serving `compressed-tensors` FP8 checkpoints is [vLLM](https://github.com/vllm-project/vllm).
68
 
69
- #### Launch OpenAI-Compatible Server
70
 
71
  ```bash
72
- vllm serve prithivMLmods/OxCoder-9B-fp8 \
73
- --max-model-len 262144 \
74
- --tensor-parallel-size 1 \
75
- --gpu-memory-utilization 0.95
76
 
 
 
 
 
77
  ```
78
 
79
- #### Python Inference via vLLM
80
 
81
  ```python
82
  from vllm import LLM, SamplingParams
83
 
 
 
 
 
 
 
84
  llm = LLM(
85
  model="prithivMLmods/OxCoder-9B-fp8",
86
- max_model_len=65536, # Adjust to your GPU VRAM limit
87
- trust_remote_code=True
88
  )
89
 
90
- prompt = "Write a React component that manages an editable data grid with undo/redo capabilities."
91
- sampling_params = SamplingParams(temperature=0.2, max_tokens=2048)
 
92
 
93
- outputs = llm.generate([prompt], sampling_params)
94
- print(outputs[0].outputs[0].text)
 
95
  ```
96
 
97
- ### 2. Loading with Hugging Face Transformers
98
 
99
- Ensure you have `transformers` and `accelerate` installed:
 
 
100
 
101
  ```python
102
  import torch
@@ -112,12 +123,22 @@ model = AutoModelForCausalLM.from_pretrained(
112
  trust_remote_code=True
113
  )
114
 
115
- inputs = tokenizer("def parse_git_diff(patch_str: str) -> list[dict]:", return_tensors="pt").to(model.device)
116
- outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.2)
 
 
 
 
 
 
 
 
 
117
 
118
- print(tokenizer.decode(outputs[0], skip_special_tokens=True))
119
  ```
120
 
121
- ## License
122
 
123
- This model card and weights follow the upstream [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
 
 
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).