File size: 1,290 Bytes
a4d995a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: mit
library_name: openvino
tags:
  - openvino
  - int8
  - text-generation
  - phi
  - llm
---

# Phi-2 OpenVINO (INT8)

OpenVINO IR conversion of [microsoft/Phi-2](https://huggingface.co/microsoft/Phi-2) with weight-only INT8 quantization, produced on CPU-only Kaggle with `optimum-cli` (fully offline, token-free).

- Base model: `microsoft/Phi-2` (PhiForCausalLM, 2.7B params, MIT)
- Task: `text-generation`
- Precision: weights INT8 (NNCF), activations FP16/FP32 as traced
- Converted with: `optimum-intel 2.2.0`, `openvino 2026.4.1`, `transformers 5.16.1`
- 2.7B "textbook-scale" model trained on NLP/STEM data; strong for its size

## Usage

### optimum-intel

```python
from optimum.intel import OVModelForCausalLM
from transformers import AutoTokenizer

model = OVModelForCausalLM.from_pretrained("Nekodeus/phi2-openvino")
tok = AutoTokenizer.from_pretrained("Nekodeus/phi2-openvino")
inputs = tok("My name is Phi and I", return_tensors="pt")
print(tok.decode(model.generate(**inputs, max_new_tokens=128)[0]))
```

### OpenVINO GenAI

```cpp
ov::genai::LLMPipeline pipe("path/to/Nekodeus/phi2-openvino", "CPU");
```

## Reproduce

```bash
optimum-cli export openvino \
  --model microsoft/Phi-2 \
  --task text-generation \
  --weight-format int8 \
  phi2-openvino
```