---
title: "A Chatbot on your Laptop: Phi-2 on Intel Meteor Lake"
description: "Microsoft's 2.7B-parameter Phi-2 can run as a usable local chatbot on a mid-range Intel Core Ultra 7 155H (Meteor Lake) laptop once its weights are quantized to 4-bit with OpenVINO through Hugging Face's Optimum Intel library."
url: "https://swe.quest/articles/a-chatbot-on-your-laptop-phi-2-on-intel-meteor-lake-3ad1272519c8d71d"
canonical: "https://huggingface.co/blog/phi2-intel-meteor-lake"
source: "Hugging Face"
published: "2024-03-20"
difficulty: "medium"
kind: "How-to"
reading_minutes: 7
tags: ["inference","llms","hardware","python"]
---

# A Chatbot on your Laptop: Phi-2 on Intel Meteor Lake

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-03-20, 7 min read, How-to. Original: [https://huggingface.co/blog/phi2-intel-meteor-lake](https://huggingface.co/blog/phi2-intel-meteor-lake)

## Summary

Microsoft's 2.7B-parameter Phi-2 can run as a usable local chatbot on a mid-range Intel Core Ultra 7 155H (Meteor Lake) laptop once its weights are quantized to 4-bit with OpenVINO through Hugging Face's Optimum Intel library. The walkthrough covers Meteor Lake's CPU, iGPU (Xe Vector Engines with DP4a) and NPU, then shows code using OVWeightQuantizationConfig with bits=4, group\_size=128 and ratio=0.8, where 80% of weights go to 4-bit and the rest to 8-bit. Lowering ratio or group size improves accuracy but costs model size and latency. Generation quality and speed are shown only through demo videos, with no measured benchmarks.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Hardware](https://swe.quest/tags/hardware.md) (Infrastructure)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- Hugging Face Transformers
- LLM quantization basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

Phi-2, OpenVINO, Optimum Intel, Intel Meteor Lake, Intel Core Ultra, NNCF

## Related posts

- [Making LLMs lighter with AutoGPTQ and transformers](https://swe.quest/articles/making-llms-lighter-with-autogptq-and-transformers-6a1ce27ee3288303.md): Hugging Face · 2023-08-23 · Medium · 10 min read · Inference & serving, LLMs, Performance engineering, Hardware
  AutoGPTQ is now integrated into Hugging Face Transformers (via Optimum), letting users quantize and run LLMs at 8, 4, 3 or 2 bits with the GPTQ post-training method.
- [Optimize and deploy with Optimum-Intel and OpenVINO GenAI](https://swe.quest/articles/optimize-and-deploy-with-optimum-intel-and-openvino-genai-bbd6caef1a74949e.md): Hugging Face · 2024-09-20 · Medium · 6 min read · Inference & serving, LLMs, C & C++, Python
  Hugging Face Transformers LLMs can be exported to OpenVINO IR with Optimum-Intel, quantized with NNCF, and deployed through the lightweight OpenVINO GenAI LLMPipeline from Python or C++.
- [Making LLMs even more accessible with bitsandbytes, 4-bit quantization and QLoRA](https://swe.quest/articles/making-llms-even-more-accessible-with-bitsandbytes-4-bit-quantization-and-qlora-7bc797d3e83b0ec6.md): Hugging Face · 2023-05-24 · Medium · 14 min read · Inference & serving, Model training, LLMs, Python
  bitsandbytes now integrates 4-bit quantization into Hugging Face transformers, letting most accelerate-loadable models (text, vision, multimodal) run in 4-bit and be fine-tuned via QLoRA, which backpropagates through a frozen 4-bit base model into LoRA adapters.
- [Quanto: a PyTorch quantization backend for Optimum](https://swe.quest/articles/quanto-a-pytorch-quantization-backend-for-optimum-8330ba5aea428b63.md): Hugging Face · 2024-03-18 · Medium · 5 min read · Inference & serving, Python, Machine learning, Open source
  Quanto is a PyTorch quantization backend for Optimum that works in eager mode on any device (CPU, CUDA, MPS), supports int2/int4/int8/float8 weights and int8/float8 activations, and accelerates int8-int8, fp16-int4, bf16-int8 and bf16-int4 matmuls on CUDA.
- [Blazing Fast SetFit Inference with 🤗 Optimum Intel on Xeon](https://swe.quest/articles/blazing-fast-setfit-inference-with-optimum-intel-on-xeon-804c53c4c80ba1a3.md): Hugging Face · 2024-04-03 · Medium · 6 min read · Inference & serving, Performance engineering, Hardware, Python
  Post-training static int8 quantization of a SetFit model body with Optimum Intel and Intel Neural Compressor speeds up inference on Xeon CPUs by up to 7.8x in throughput with negligible accuracy loss.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
