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