---
title: remove_cache_key
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/others/llmdatadistdev/llmpr_42_0039.html
sourcePath: /source/zh/canncommercial/900/others/llmdatadistdev/llmpr_42_0039.html
indexId: 0d666ea3bdbebfed5c4ef2b04c86311f72e4b6307e30a451eee84f9e95acda5d70
---
# remove_cache_key

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| 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，仅当LLMRole为PROMPT时可调用。

移除CacheKey后，该Cache将无法再被pull_cache拉取。


#### 函数原型

```
remove_cache_key(cache_key: CacheKey)
```


#### 参数说明

| 参数名称 | 数据类型 | 取值说明 |
| --- | --- | --- |
| cache\_key | CacheKey | 需要被移除的CacheKey。 |


#### 调用示例

```
cache_keys = [CacheKey(prompt_cluster_id=0, req_id=1)]
kv_cache_manager.remove_cache_key(cache_keys[0])
```


#### 返回值

正常情况下无返回值。

参数错误可能抛出TypeError或ValueError。

执行时间超过sync_kv_timeout配置会抛出LLMException异常。


#### 约束说明

- 如果CacheKey不存在或已移除，该操作为空操作。
- 本接口不支持并发调用。
