---
title: CacheKey
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/hixlug/llmprv2_42_0056.html
sourcePath: /source/zh/canncommercial/900/API/hixlug/llmprv2_42_0056.html
indexId: 2e617e647341bc0a22cb56cd6d38f5f00d8a52794902fb4723209f884fb9385461
---
# CacheKey

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | x |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | x |
| Atlas 推理系列产品 | x |
| Atlas 训练系列产品 | x |


说明：针对 Atlas A2 训练系列产品 / Atlas A2 推理系列产品 ，仅支持Atlas 800I A2 推理服务器、A200I A2 Box 异构组件。


#### 函数功能

构造CacheKey，通常CacheManager的allocate_cache、pull_cache接口中作为参数类型使用。


#### 函数原型

```
__init__(*args, **kwargs)
```


#### 参数说明

| 参数名称 | 数据类型 | 取值说明 |
| --- | --- | --- |
| cluster\_id | int | cache所在远端集群id，必填。 |
| req\_id | int | cache关联的req\_id，必填。 |
| model\_id | int | cache关联的model\_id，默认为0。 |
| prefix\_id | int | cache关联的公共前缀id，默认为2的64次方\-1。 |


#### 调用示例

```
from llm_datadist import CacheKey
cache_key = CacheKey(0, 1, 0)
```


#### 返回值

正常情况下返回CacheKey的实例。

传入数据类型错误情况下会抛出TypeError或ValueError异常。


#### 约束说明

无
