Skip to content

v0.2.6: API 키 풀 + Least-Connections 분배

Choose a tag to compare

@github-actions github-actions released this 13 Feb 12:56
· 14 commits to master since this release

API 키 풀 + Least-Connections 분배

일부 제공자(예: GLM-5)는 API 키당 동시 요청 수를 제한합니다. 여러 API 키를 풀로 등록하고 Least-Connections 방식으로 분배하여 총 동시 처리 용량을 확보합니다.

새 기능

  • auth.pool: 같은 헤더를 공유하는 추가 API 키 목록
  • concurrency: 키당 동시 요청 제한 (예: GLM-5=1, GLM-4-Plus=20)
  • Least-Connections 분배: 활성 연결이 가장 적은 키로 자동 분배
  • 자동 해제: 스트리밍 응답 종료 시 PoolGuard가 키를 자동 반환
  • 용량 초과 처리: 모든 키 소진 시 Anthropic 폴백(fallback: true) 또는 HTTP 429

설정 예시

routes:
  - match: "glm-5"
    concurrency: 1
    upstream:
      url: "https://open.bigmodel.cn/api/paas/v4"
      auth:
        header: "Authorization"
        value: "Bearer ${GLM_KEY_1}"
        pool:
          - "Bearer ${GLM_KEY_2}"
          - "Bearer ${GLM_KEY_3}"
    transformer: "openai"
    model_map: "glm-5"

하위 호환

pool/concurrency 미설정 시 기존 동작 그대로 유지됩니다.


Full Changelog: v0.2.5...v0.2.6