Skip to main content

health

{
"status": "ok"
}

/health/liveliness

Unprotected endpoint for checking if proxy is alive

Example Request:

curl http://0.0.0.0:4000/health/liveliness

Example Response:

{
"status": "ok"
}
{
"status": "已连接",
"db": "已连接",
"cache": null,
"litellm_version": "1.40.21",
"success_callbacks": [
"langfuse",
"_PROXY_跟踪成本回调",
"响应时间过长回调",
"_PROXY_最大并行请求处理程序",
"_PROXY_预算上限限制器",
"_PROXY_缓存控制检查",
"服务日志记录"
],
"last_updated": "2024-07-10T18:59:10.616968"
}

如果代理未连接到数据库,则 "db" 字段将显示为 "Not connected" 而不是 "connected",并且 "last_updated" 字段将不会出现。

/health/liveliness

用于检查代理是否存活的无需保护的端点

示例请求:

curl -X 'GET' \
'http://0.0.0.0:4000/health/liveliness' \
-H 'accept: application/json'

示例响应:

"I'm alive!"

高级 - 调用特定模型

要检查特定模型的健康状况,请按以下方式调用它们:

1. 通过 /model/info 获取模型 ID

curl -X GET 'http://0.0.0.0:4000/v1/model/info' \
--header 'Authorization: Bearer sk-1234' \

预期响应

{
"model_name": "bedrock-anthropic-claude-3",
"litellm_params": {
"model": "anthropic.claude-3-sonnet-20240229-v1:0"
},
"model_info": {
"id": "634b87c444..", # 👈 唯一模型 ID
}

2. 通过 /chat/completions 调用特定模型

curl -X POST 'http://localhost:4000/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-1234' \
-D '{
"model": "634b87c444.." # 👈 唯一模型 ID
"messages": [
{
"role": "user",
"content": "ping"
}
],
}
'
优云智算