---
title: CodeLlama-13b-hf-8bit-mlx
canonical_url: "https://www.modelscope.cn/models/mlx-community/CodeLlama-13b-hf-8bit-mlx"
md_url: "https://www.modelscope.cn/models/mlx-community/CodeLlama-13b-hf-8bit-mlx.md"
repository: mlx-community/CodeLlama-13b-hf-8bit-mlx
last_updated: 2025-04-28
license: llama2
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - llama
architectures:
  - LlamaForCausalLM
base_model:
  - codellama/CodeLlama-13b-hf
base_model_relation: quantized
parameters: 3.7B
tensor_type:
  - U32
  - F16
library_name:
  - mlx
  - safetensors
  - pytorch
frameworks:
  - pytorch
language:
  - code
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy 0.9.1"
  - "lmdeploy_turbomind 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 368
stars: 0
tags:
  - llama-2
  - mlx
---

# CodeLlama-13b-hf-8bit-mlx

> CodeLlama-13b-hf-8bit-mlx - mlx-community 在 ModelScope 开源的模型。mlx-community/CodeLlama-13b-hf-8bit-mlx

mlx-community/CodeLlama-13b-hf-8bit-mlx 是 ModelScope 魔搭社区上的 3.7B 参数text-generation模型，采用 llama2 许可，基于 codellama/CodeLlama-13b-hf 构建，可用 deploy_task text/emb、lmdeploy 0.9.1、lmdeploy_turbomind 0.9.1 部署。

- **Repository**: mlx-community/CodeLlama-13b-hf-8bit-mlx
- **License**: llama2
- **Tasks**: text-generation
- **Parameters**: 3.7B
- **Base model**: codellama/CodeLlama-13b-hf
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, lmdeploy_turbomind 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Tags**: llama-2, mlx
- **Downloads**: 368
- **Stars**: 0
- **Last updated**: 2025-04-28

Source: https://www.modelscope.cn/models/mlx-community/CodeLlama-13b-hf-8bit-mlx

---

# mlx-community/CodeLlama-13b-hf-8bit-mlx

This model [mlx-community/CodeLlama-13b-hf-8bit-mlx](https://huggingface.co/mlx-community/CodeLlama-13b-hf-8bit-mlx) was
converted to MLX format from [codellama/CodeLlama-13b-hf](https://huggingface.co/codellama/CodeLlama-13b-hf)
using mlx-lm version **0.23.2**.

## Use with mlx

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

```python
from mlx_lm import load, generate

model, tokenizer = load("mlx-community/CodeLlama-13b-hf-8bit-mlx")

prompt = "hello"

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

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