---
title: codegemma-1.1-2b-6bit
canonical_url: "https://www.modelscope.cn/models/mlx-community/codegemma-1.1-2b-6bit"
md_url: "https://www.modelscope.cn/models/mlx-community/codegemma-1.1-2b-6bit.md"
repository: mlx-community/codegemma-1.1-2b-6bit
last_updated: 2025-06-01
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - gemma
architectures:
  - GemmaForCausalLM
parameters: 548.3M
tensor_type:
  - U32
  - BF16
library_name:
  - safetensors
  - pytorch
frameworks:
  - pytorch
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 271
stars: 0
---

# codegemma-1.1-2b-6bit

> codegemma-1.1-2b-6bit - mlx-community 在 ModelScope 开源的模型。mlx-community/codegemma-1.1-2b-6bit

mlx-community/codegemma-1.1-2b-6bit 是 ModelScope 魔搭社区上的 548.3M 参数text-generation模型，可用 deploy_task text/emb、lmdeploy 0.9.1、sglang 0.5.2 部署。

- **Repository**: mlx-community/codegemma-1.1-2b-6bit
- **Tasks**: text-generation
- **Parameters**: 548.3M
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Downloads**: 271
- **Stars**: 0
- **Last updated**: 2025-06-01

Source: https://www.modelscope.cn/models/mlx-community/codegemma-1.1-2b-6bit

---

# mlx-community/codegemma-1.1-2b-6bit

The Model [mlx-community/codegemma-1.1-2b-6bit](https://huggingface.co/mlx-community/codegemma-1.1-2b-6bit) was converted to MLX format from [google/codegemma-1.1-2b](https://huggingface.co/google/codegemma-1.1-2b) using mlx-lm version **0.24.1**.

## Use with mlx

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

```python
from mlx_lm import load, generate

model, tokenizer = load("mlx-community/codegemma-1.1-2b-6bit")

prompt="hello"

if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
    messages = [{"role": "user", "content": prompt}]
    prompt = tokenizer.apply_chat_template(
        messages, tokenize=False, add_generation_prompt=True
    )

response = generate(model, tokenizer, prompt=prompt, verbose=True)
```
