AiRelay
LLM relay 어댑터 — OpenAI-compatible 호출 + 응답 정규화 (LiteLLM 호환, Chorus 제외)
상태
| 항목 | 값 |
|---|---|
| Layer | core |
| Tier | L1 |
| Status | released |
| Version | 1.0.0 |
| 가격 | Free (free) |
| **카� | |
| �고리** | AI / LLM |
개요
개요
AiRelay 는 multi-saas-kit 의 Layer 1 Core Plugin �
니다. apis.how 의 External-First 원칙(/api/v1/edge/... mint → relay 단일 흐름)에 따라 OpenAI-compatible LLM 호출 어댑터를 표준화한 plugin.
LiteLLM 을 LLM control plane 으로, virtual key + model alias 사용. apis.how 는 자체 LLM 을 재구현하지 않고 운영 정� /토큰 관리/문서화/확장 레이어에 집중.
범위 경계: Chorus 는 로컬 또는 서버에 설치된 AI Agent CLI 를 subprocess 로 실행하는 orchestration 계층이므로 AiRelay 범위가 아닙니다. Chorus 통합은 별도 AgentCliBridge/ChorusBridge plugin � 임� 니다.
핵심 컴포넌트
TextContentExtractor (Pure)
OpenAI-compatible chat completion payload 에서 text 추출. apis.how LlmApiRelayClient::extractText 추출.
두 가지 shape 지원:
choices[0].message.content = "string"choices[0].message.content = [{type:'text', text:'...'}, ...](multi-part)
image 등 비-text 항목은 자동 skip.
RelayResponseNormalizer (Pure)
LLM relay 응답 표준화 — apis.how 의 표준 shape 으로 변환:
success: { status: 'success', data: { text, model, usage, raw }, relay_meta: {...} }
error: { status: 'error', error: { code, message, http_status }, relay_meta: {...} }
relay_meta — mode, relay_elapsed_ms, upstream_http_status. 호출자가 audit log / 사용량 분석에 활용.
HTTP 4xx/5xx 자동 감지, error payload 에서 error.code / error.message 추출.