---
title: gemma-2-2b-it-4bit
canonical_url: "https://www.modelscope.cn/models/mlx-community/gemma-2-2b-it-4bit"
md_url: "https://www.modelscope.cn/models/mlx-community/gemma-2-2b-it-4bit.md"
repository: mlx-community/gemma-2-2b-it-4bit
last_updated: 2024-12-19
license: gemma
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - gemma2
architectures:
  - Gemma2ForCausalLM
parameters: 408.7M
tensor_type:
  - F16
  - U32
library_name:
  - mlx
  - safetensors
  - pytorch
frameworks:
  - pytorch
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 1021
stars: 1
tags:
  - conversational
  - mlx
---

# gemma-2-2b-it-4bit

> gemma-2-2b-it-4bit - mlx-community 在 ModelScope 开源的模型。mlx-community/gemma-2-2b-it-4bit

mlx-community/gemma-2-2b-it-4bit 是 ModelScope 魔搭社区上的 408.7M 参数text-generation模型，采用 gemma 许可，可用 deploy_task text/emb、lmdeploy 0.9.1、sglang 0.5.2 部署。

- **Repository**: mlx-community/gemma-2-2b-it-4bit
- **License**: gemma
- **Tasks**: text-generation
- **Parameters**: 408.7M
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Tags**: conversational, mlx
- **Downloads**: 1021
- **Stars**: 1
- **Last updated**: 2024-12-19

Source: https://www.modelscope.cn/models/mlx-community/gemma-2-2b-it-4bit

---

# mlx-community/gemma-2-2b-it-4bit

The Model [mlx-community/gemma-2-2b-it-4bit](https://huggingface.co/mlx-community/gemma-2-2b-it-4bit) was converted to MLX format from [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it) using mlx-lm version **0.16.1**.

## Use with mlx

```bash
pip install mlx-lm
```

```python
from mlx_lm import load, generate

model, tokenizer = load("mlx-community/gemma-2-2b-it-4bit")
response = generate(model, tokenizer, prompt="hello", verbose=True)
```
