delete-model

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Delete Model

删除模型

Remove a model from a live LiteLLM proxy.
从运行中的LiteLLM代理移除模型。

Setup

配置

LITELLM_BASE_URL  — e.g. https://my-proxy.example.com
LITELLM_API_KEY   — proxy admin key
LITELLM_BASE_URL  — 示例:https://my-proxy.example.com
LITELLM_API_KEY   — 代理管理员密钥

Ask the user

询问用户信息

  1. Model name or model_id — if they give a name, look up the ID first:
    bash
    curl -s "$BASE/model/info" -H "Authorization: Bearer $KEY" | python3 -c "
    import sys,json
    for m in json.load(sys.stdin).get('data',[]):
      print(m['model_info']['id'], m['model_name'])
    "
  2. Confirm — show the model name and ask for confirmation before deleting.
  1. 模型名称或model_id — 如果用户提供的是名称,需先查询对应的ID:
    bash
    curl -s "$BASE/model/info" -H "Authorization: Bearer $KEY" | python3 -c "
    import sys,json
    for m in json.load(sys.stdin).get('data',[]):
      print(m['model_info']['id'], m['model_name'])
    "
  2. 确认 — 显示模型名称,并在删除前请求用户确认。

Run

执行操作

bash
curl -s -X POST "$BASE/model/delete" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"id": "<model_id>"}'
bash
curl -s -X POST "$BASE/model/delete" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"id": "<model_id>"}'

Output

输出结果

Show the success message. Warn the user that any keys scoped to this model name will start getting errors.
显示成功提示信息。提醒用户任何与此模型名称绑定的密钥将开始报错。