오류 진단 - 공급자 vs 게이트웨이
오류 진단 - 공급자 vs 게이트웨이 (Diagnosing Errors - Provider vs Gateway)
오류가 LLM 공급자(OpenAI, Anthropic 등)에서 왔는지 LiteLLM AI 게이트웨이 자체에서 왔는지 진단하는 데 어려움이 있나요? 구분하는 방법을 알려드려요.
출처: 문서
본문
전체 오류 페이로드 스키마, 상태 코드와 오류 타입 참조, 폴백 소진 동작은 Error Reference를 보세요.
빠른 규칙 (Quick Rule)
오류에 <Provider>Exception이 포함되어 있으면 공급자에서 온 것이에요.
| 오류에 포함된 것 | 오류 소스 |
|---|---|
| AnthropicException | Anthropic |
| OpenAIException | OpenAI |
| AzureException | Azure |
| BedrockException | AWS Bedrock |
| VertexAIException | Google Vertex AI |
| 공급자 이름 없음 | LiteLLM AI Gateway |
예시 (Examples)
공급자 오류 (AWS Bedrock에서) (Provider Error (from AWS Bedrock))
{
"error": {
"message": "litellm.BadRequestError: BedrockException - {\"message\":\"The model returned the following errors: messages.1.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`.\"}",
"type": "invalid_request_error",
"param": null,
"code": "400"
}
}
이 오류는 AWS Bedrock에서 온 것이에요 (BedrockException 확인). Bedrock API가 잘못된 메시지 형식으로 요청을 거부하는 것 — 이는 LiteLLM 문제가 아니에요.
공급자 오류 (OpenAI에서) (Provider Error (from OpenAI))
{
"error": {
"message": "litellm.AuthenticationError: OpenAIException - Incorrect API key provided: <my-key>. You can find your API key at https://platform.openai.com/account/api-keys.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"
}
}
이 오류는 OpenAI에서 온 것이에요 (OpenAIException 확인). LiteLLM에 구성된 OpenAI API 키가 유효하지 않아요.
공급자 오류 (Anthropic에서) (Provider Error (from Anthropic))
{
"error": {
"message": "litellm.InternalServerError: AnthropicException - Overloaded. Handle with `litellm.InternalServerError`.",
"type": "internal_server_error",
"param": null,
"code": "500"
}
}
이 오류는 Anthropic에서 온 것이에요 (AnthropicException 확인). Anthropic API가 과부하 상태 — 이는 LiteLLM 문제가 아니에요.
게이트웨이 오류 (LiteLLM에서) (Gateway Error (from LiteLLM))
{
"error": {
"message": "Invalid API Key. Please check your LiteLLM API key.",
"type": "auth_error",
"param": null,
"code": "401"
}
}
이 오류는 LiteLLM AI 게이트웨이(공급자 이름 없음)에서 온 것이에요. LiteLLM 가상 키가 유효하지 않아요.
무엇을 해야 하나요? (What to do?)
| 오류 소스 | 조치 |
|---|---|
| 공급자 오류 | 공급자의 상태 페이지를 확인하고, 요율 제한을 조정하거나 나중에 재시도하기 |
| 게이트웨이 오류 | LiteLLM 구성, API 키를 확인하거나 이슈 열기 |
함께 보기 (See Also)
- Debugging - 상세 요청/응답 정보를 보려면 디버그 로그 활성화
- Exception Mapping - LiteLLM 예외 유형의 전체 목록