프로바이더

프로바이더

CC-Relay는 통합 인터페이스를 통해 여러 LLM 프로바이더를 지원합니다. 이 페이지에서는 각 프로바이더의 설정 방법을 설명합니다.

개요

CC-Relay는 Claude Code와 다양한 LLM 백엔드 사이의 프록시 역할을 합니다. 모든 프로바이더는 Anthropic 호환 Messages API를 제공하여 프로바이더 간 원활한 전환이 가능합니다.

프로바이더타입설명비용
Anthropicanthropic직접 Anthropic API 접근표준 Anthropic 가격
Z.AIzaiZhipu AI GLM 모델, Anthropic 호환Anthropic 가격의 약 1/7
MiniMaxminimaxMiniMax 모델, Anthropic 호환MiniMax 가격
Ollamaollama로컬 LLM 추론무료 (로컬 컴퓨팅)
AWS BedrockbedrockSigV4 인증으로 AWS 경유 ClaudeAWS Bedrock 가격
Azure AI FoundryazureAzure MAAS 경유 ClaudeAzure AI 가격
Google Vertex AIvertexGoogle Cloud 경유 ClaudeVertex AI 가격

Anthropic 프로바이더

Anthropic 프로바이더는 Anthropic의 API에 직접 연결합니다. Claude 모델에 대한 완전한 접근을 위한 기본 프로바이더입니다.

설정

providers:
- name: "anthropic"
  type: "anthropic"
  enabled: true
  base_url: "https://api.anthropic.com"  # 선택사항, 기본값 사용

  keys:
    - key: "${ANTHROPIC_API_KEY}"
      rpm_limit: 60        # 분당 요청 수
      tpm_limit: 100000    # 분당 토큰 수
      priority: 2          # 높음 = 장애 조치에서 먼저 시도

  models:
    - "claude-sonnet-4-5-20250514"
    - "claude-opus-4-5-20250514"
    - "claude-haiku-3-5-20241022"
[[providers]]
name = "anthropic"
type = "anthropic"
enabled = true
base_url = "https://api.anthropic.com"  # Optional, uses default

[[providers.keys]]
key = "${ANTHROPIC_API_KEY}"
rpm_limit = 60        # Requests per minute
tpm_limit = 100000    # Tokens per minute
priority = 2          # Higher = tried first in failover

models = [
"claude-sonnet-4-5-20250514",
"claude-opus-4-5-20250514",
"claude-haiku-3-5-20241022"
]

API 키 설정

  1. console.anthropic.com에서 계정 생성
  2. Settings > API Keys로 이동
  3. 새 API 키 생성
  4. 환경 변수에 저장: export ANTHROPIC_API_KEY="sk-ant-..."

투명 인증 지원

Anthropic 프로바이더는 Claude Code 구독 사용자의 투명 인증을 지원합니다. 활성화하면 cc-relay가 구독 토큰을 변경 없이 전달합니다:

server:
auth:
  allow_subscription: true
[server.auth]
allow_subscription = true
# 구독 토큰이 변경 없이 전달됩니다
export ANTHROPIC_BASE_URL="http://localhost:8787"
claude

자세한 내용은 투명 인증을 참조하세요.

Z.AI 프로바이더

Z.AI(Zhipu AI)는 Anthropic 호환 API를 통해 GLM 모델을 제공합니다. API 호환성을 유지하면서 상당한 비용 절감(Anthropic 가격의 약 1/7)을 제공합니다.

설정

providers:
- name: "zai"
  type: "zai"
  enabled: true
  base_url: "https://api.z.ai/api/anthropic"  # 선택사항, 기본값 사용

  keys:
    - key: "${ZAI_API_KEY}"
      priority: 1  # 장애 조치 시 Anthropic보다 낮은 우선순위

  # Claude 모델 이름을 Z.AI 모델에 매핑
  model_mapping:
    "claude-sonnet-4-5-20250514": "GLM-4.7"
    "claude-sonnet-4-5": "GLM-4.7"
    "claude-haiku-3-5-20241022": "GLM-4.5-Air"
    "claude-haiku-3-5": "GLM-4.5-Air"

  models:
    - "GLM-4.7"
    - "GLM-4.5-Air"
    - "GLM-4-Plus"
[[providers]]
name = "zai"
type = "zai"
enabled = true
base_url = "https://api.z.ai/api/anthropic"  # Optional, uses default

[[providers.keys]]
key = "${ZAI_API_KEY}"
priority = 1  # Lower priority than Anthropic for failover

# Map Claude model names to Z.AI models
[providers.model_mapping]
"claude-sonnet-4-5-20250514" = "GLM-4.7"
"claude-sonnet-4-5" = "GLM-4.7"
"claude-haiku-3-5-20241022" = "GLM-4.5-Air"
"claude-haiku-3-5" = "GLM-4.5-Air"

models = [
"GLM-4.7",
"GLM-4.5-Air",
"GLM-4-Plus"
]

API 키 설정

  1. z.ai/model-api에서 계정 생성
  2. API Keys 섹션으로 이동
  3. 새 API 키 생성
  4. 환경 변수에 저장: export ZAI_API_KEY="..."

10% 할인: 구독 시 이 초대 링크를 사용하면 본인과 추천인 모두 10% 할인을 받을 수 있습니다.

Model Mapping

Model Mapping은 Anthropic 모델 이름을 Z.AI 동등 모델로 변환합니다. Claude Code가 claude-sonnet-4-5-20250514를 요청하면 cc-relay가 자동으로 GLM-4.7로 라우팅합니다:

model_mapping:
# Claude Sonnet -> GLM-4.7 (플래그십 모델)
"claude-sonnet-4-5-20250514": "GLM-4.7"
"claude-sonnet-4-5": "GLM-4.7"

# Claude Haiku -> GLM-4.5-Air (빠름, 경제적)
"claude-haiku-3-5-20241022": "GLM-4.5-Air"
"claude-haiku-3-5": "GLM-4.5-Air"
[model_mapping]
# Claude Sonnet -> GLM-4.7 (flagship model)
"claude-sonnet-4-5-20250514" = "GLM-4.7"
"claude-sonnet-4-5" = "GLM-4.7"

# Claude Haiku -> GLM-4.5-Air (fast, economical)
"claude-haiku-3-5-20241022" = "GLM-4.5-Air"
"claude-haiku-3-5" = "GLM-4.5-Air"

비용 비교

모델Anthropic (백만 토큰당)Z.AI 동등Z.AI 비용
claude-sonnet-4-5$3 입력 / $15 출력GLM-4.7~$0.43 / $2.14
claude-haiku-3-5$0.25 입력 / $1.25 출력GLM-4.5-Air~$0.04 / $0.18

가격은 대략적이며 변경될 수 있습니다.

Ollama 프로바이더

Ollama는 Anthropic 호환 API(Ollama v0.14 이후 사용 가능)를 통해 로컬 LLM 추론을 가능하게 합니다. 프라이버시, API 비용 없음, 오프라인 운영을 위해 로컬에서 모델을 실행합니다.

설정

providers:
- name: "ollama"
  type: "ollama"
  enabled: true
  base_url: "http://localhost:11434"  # 선택사항, 기본값 사용

  keys:
    - key: "ollama"  # Ollama는 API 키를 받지만 무시함
      priority: 0    # 장애 조치의 최저 우선순위

  # Claude 모델 이름을 로컬 Ollama 모델에 매핑
  model_mapping:
    "claude-sonnet-4-5-20250514": "qwen3:32b"
    "claude-sonnet-4-5": "qwen3:32b"
    "claude-haiku-3-5-20241022": "qwen3:8b"
    "claude-haiku-3-5": "qwen3:8b"

  models:
    - "qwen3:32b"
    - "qwen3:8b"
    - "codestral:latest"
[[providers]]
name = "ollama"
type = "ollama"
enabled = true
base_url = "http://localhost:11434"  # Optional, uses default

[[providers.keys]]
key = "ollama"  # Ollama accepts but ignores API keys
priority = 0    # Lowest priority for failover

# Map Claude model names to local Ollama models
[providers.model_mapping]
"claude-sonnet-4-5-20250514" = "qwen3:32b"
"claude-sonnet-4-5" = "qwen3:32b"
"claude-haiku-3-5-20241022" = "qwen3:8b"
"claude-haiku-3-5" = "qwen3:8b"

models = [
"qwen3:32b",
"qwen3:8b",
"codestral:latest"
]

Ollama 설정

  1. ollama.com에서 Ollama 설치
  2. 사용하려는 모델 풀:
    ollama pull qwen3:32b
    ollama pull qwen3:8b
    ollama pull codestral:latest
  3. Ollama 시작 (설치 시 자동 실행)

권장 모델

Claude Code 워크플로우에는 최소 32K 컨텍스트를 가진 모델을 선택하세요:

모델컨텍스트크기최적 용도
qwen3:32b128K32B 파라미터일반 코딩, 복잡한 추론
qwen3:8b128K8B 파라미터빠른 반복, 간단한 작업
codestral:latest32K22B 파라미터코드 생성, 전문 코딩
llama3.2:3b128K3B 파라미터매우 빠름, 기본 작업

기능 제한

Ollama의 Anthropic 호환성은 부분적입니다. 일부 기능은 지원되지 않습니다:

기능지원참고
Streaming (SSE)Anthropic과 동일한 이벤트 시퀀스
Tool callingAnthropic과 동일한 형식
Extended thinking부분budget_tokens 허용되지만 적용되지 않음
Prompt caching아니오cache_control 블록 무시됨
PDF 입력아니오지원되지 않음
이미지 URL아니오Base64 인코딩만 지원
토큰 카운팅아니오/v1/messages/count_tokens 사용 불가
tool_choice아니오특정 도구 사용 강제 불가

Docker 네트워킹

Docker에서 cc-relay를 실행하고 호스트에서 Ollama를 실행할 때:

providers:
- name: "ollama"
  type: "ollama"
  # localhost 대신 Docker의 호스트 게이트웨이 사용
  base_url: "http://host.docker.internal:11434"
[[providers]]
name = "ollama"
type = "ollama"
# Use Docker's host gateway instead of localhost
base_url = "http://host.docker.internal:11434"

또는 --network host로 cc-relay 실행:

docker run --network host cc-relay

AWS Bedrock 프로바이더

AWS Bedrock은 엔터프라이즈 보안과 SigV4 인증을 통해 Amazon Web Services를 통한 Claude 접근을 제공합니다.

설정

providers:
- name: "bedrock"
  type: "bedrock"
  enabled: true

  # AWS region (required)
  aws_region: "us-east-1"

  # Explicit AWS credentials (optional)
  # If not set, uses AWS SDK default credential chain:
  # 1. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
  # 2. Shared credentials file (~/.aws/credentials)
  # 3. IAM role (EC2, ECS, Lambda)
  aws_access_key_id: "${AWS_ACCESS_KEY_ID}"
  aws_secret_access_key: "${AWS_SECRET_ACCESS_KEY}"

  # Map Claude model names to Bedrock model IDs
  model_mapping:
    "claude-sonnet-4-5-20250514": "anthropic.claude-sonnet-4-5-20250514-v1:0"
    "claude-sonnet-4-5": "anthropic.claude-sonnet-4-5-20250514-v1:0"
    "claude-haiku-3-5-20241022": "anthropic.claude-haiku-3-5-20241022-v1:0"

  keys:
    - key: "bedrock-internal"  # Internal key for cc-relay auth
[[providers]]
name = "bedrock"
type = "bedrock"
enabled = true

# AWS region (required)
aws_region = "us-east-1"

# Explicit AWS credentials (optional)
# If not set, uses AWS SDK default credential chain:
# 1. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
# 2. Shared credentials file (~/.aws/credentials)
# 3. IAM role (EC2, ECS, Lambda)
aws_access_key_id = "${AWS_ACCESS_KEY_ID}"
aws_secret_access_key = "${AWS_SECRET_ACCESS_KEY}"

# Map Claude model names to Bedrock model IDs
[providers.model_mapping]
"claude-sonnet-4-5-20250514" = "anthropic.claude-sonnet-4-5-20250514-v1:0"
"claude-sonnet-4-5" = "anthropic.claude-sonnet-4-5-20250514-v1:0"
"claude-haiku-3-5-20241022" = "anthropic.claude-haiku-3-5-20241022-v1:0"

[[providers.keys]]
key = "bedrock-internal"  # Internal key for cc-relay auth

AWS 설정

  1. Enable Bedrock Access: In AWS Console, navigate to Bedrock > Model access and enable Claude models
  2. Configure Credentials: Use one of these methods:
    • Environment Variables: export AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=...
    • AWS CLI: aws configure
    • IAM Role: Attach Bedrock access policy to EC2/ECS/Lambda role

Azure AI Foundry 프로바이더

Azure AI Foundry는 엔터프라이즈 Azure 통합을 통해 Microsoft Azure를 통한 Claude 접근을 제공합니다.

설정

providers:
- name: "azure"
  type: "azure"
  enabled: true

  # Your Azure resource name (appears in URL: {name}.services.ai.azure.com)
  azure_resource_name: "my-azure-resource"

  # Azure API version (default: 2024-06-01)
  azure_api_version: "2024-06-01"

  # Azure uses x-api-key authentication (Anthropic-compatible)
  keys:
    - key: "${AZURE_API_KEY}"

  # Map Claude model names to Azure deployment names
  model_mapping:
    "claude-sonnet-4-5-20250514": "claude-sonnet-4-5"
    "claude-sonnet-4-5": "claude-sonnet-4-5"
    "claude-haiku-3-5": "claude-haiku-3-5"
[[providers]]
name = "azure"
type = "azure"
enabled = true

# Your Azure resource name (appears in URL: {name}.services.ai.azure.com)
azure_resource_name = "my-azure-resource"

# Azure API version (default: 2024-06-01)
azure_api_version = "2024-06-01"

# Azure uses x-api-key authentication (Anthropic-compatible)
[[providers.keys]]
key = "${AZURE_API_KEY}"

# Map Claude model names to Azure deployment names
[providers.model_mapping]
"claude-sonnet-4-5-20250514" = "claude-sonnet-4-5"
"claude-sonnet-4-5" = "claude-sonnet-4-5"
"claude-haiku-3-5" = "claude-haiku-3-5"

Azure 설정

  1. Create Azure AI Resource: In Azure Portal, create an Azure AI Foundry resource
  2. Deploy Claude Model: Deploy a Claude model in your AI Foundry workspace
  3. Get API Key: Copy the API key from Keys and Endpoint section
  4. Note Resource Name: Your URL is https://{resource_name}.services.ai.azure.com

Deployment Names

Azure uses deployment names as model identifiers. Create deployments in Azure AI Foundry, then map them:

model_mapping:
"claude-sonnet-4-5": "my-sonnet-deployment"  # Your deployment name
[model_mapping]
"claude-sonnet-4-5" = "my-sonnet-deployment"  # Your deployment name

Google Vertex AI 프로바이더

Vertex AI는 원활한 GCP 통합을 통해 Google Cloud를 통한 Claude 접근을 제공합니다.

설정

providers:
- name: "vertex"
  type: "vertex"
  enabled: true

  # Google Cloud project ID (required)
  gcp_project_id: "${GOOGLE_CLOUD_PROJECT}"

  # Google Cloud region (required)
  gcp_region: "us-east5"

  # Map Claude model names to Vertex AI model IDs
  model_mapping:
    "claude-sonnet-4-5-20250514": "claude-sonnet-4-5@20250514"
    "claude-sonnet-4-5": "claude-sonnet-4-5@20250514"
    "claude-haiku-3-5-20241022": "claude-haiku-3-5@20241022"

  keys:
    - key: "vertex-internal"  # Internal key for cc-relay auth
[[providers]]
name = "vertex"
type = "vertex"
enabled = true

# Google Cloud project ID (required)
gcp_project_id = "${GOOGLE_CLOUD_PROJECT}"

# Google Cloud region (required)
gcp_region = "us-east5"

# Map Claude model names to Vertex AI model IDs
[providers.model_mapping]
"claude-sonnet-4-5-20250514" = "claude-sonnet-4-5@20250514"
"claude-sonnet-4-5" = "claude-sonnet-4-5@20250514"
"claude-haiku-3-5-20241022" = "claude-haiku-3-5@20241022"

[[providers.keys]]
key = "vertex-internal"  # Internal key for cc-relay auth

GCP 설정

  1. Enable Vertex AI API: In GCP Console, enable the Vertex AI API
  2. Request Claude Access: Request access to Claude models through Vertex AI Model Garden
  3. Configure Authentication: Use one of these methods:
    • Application Default Credentials: gcloud auth application-default login
    • Service Account: Set GOOGLE_APPLICATION_CREDENTIALS environment variable
    • GCE/GKE: Uses attached service account automatically

MiniMax 프로바이더

MiniMax는 Anthropic 호환 API를 통해 대규모 언어 모델을 제공합니다. MiniMax는 코딩 작업에 적합한 고품질 모델을 경쟁력 있는 가격으로 제공합니다.

설정

providers:
- name: "minimax"
  type: "minimax"
  enabled: true
  base_url: "https://api.minimax.io/anthropic"  # 선택사항, 기본값 사용

  keys:
    - key: "${MINIMAX_API_KEY}"
      priority: 1  # 장애 조치에서 Anthropic보다 낮은 우선순위

  # Claude 모델 이름을 MiniMax 모델로 매핑
  model_mapping:
    "claude-opus-4-6": "MiniMax-M2.5"
    "claude-sonnet-4-5-20250514": "MiniMax-M2.5-highspeed"
    "claude-sonnet-4-5": "MiniMax-M2.5-highspeed"
    "claude-haiku-4-5-20251001": "MiniMax-M2.1-highspeed"
    "claude-haiku-4-5": "MiniMax-M2.1-highspeed"

  models:
    - "MiniMax-M2.5"
    - "MiniMax-M2.5-highspeed"
    - "MiniMax-M2.1"
    - "MiniMax-M2.1-highspeed"
    - "MiniMax-M2"
[[providers]]
name = "minimax"
type = "minimax"
enabled = true
base_url = "https://api.minimax.io/anthropic"  # 선택사항, 기본값 사용

[[providers.keys]]
key = "${MINIMAX_API_KEY}"
priority = 1  # 장애 조치에서 Anthropic보다 낮은 우선순위

# Claude 모델 이름을 MiniMax 모델로 매핑
[providers.model_mapping]
"claude-opus-4-6" = "MiniMax-M2.5"
"claude-sonnet-4-5-20250514" = "MiniMax-M2.5-highspeed"
"claude-sonnet-4-5" = "MiniMax-M2.5-highspeed"
"claude-haiku-4-5-20251001" = "MiniMax-M2.1-highspeed"
"claude-haiku-4-5" = "MiniMax-M2.1-highspeed"

models = [
"MiniMax-M2.5",
"MiniMax-M2.5-highspeed",
"MiniMax-M2.1",
"MiniMax-M2.1-highspeed",
"MiniMax-M2"
]

API 키 설정

  1. minimax.io에서 계정 생성
  2. API 키 섹션으로 이동
  3. 새 API 키 생성
  4. 환경 변수에 저장: export MINIMAX_API_KEY="..."

인증

MiniMax는 Anthropic에서 사용하는 x-api-key 헤더 대신 Bearer 토큰 인증을 사용합니다. CC-Relay가 이를 자동으로 처리합니다 — 추가 설정이 필요 없습니다.

사용 가능한 모델

모델설명
MiniMax-M2.5플래그십 모델, 최고 품질
MiniMax-M2.5-highspeedM2.5의 고속 변형
MiniMax-M2.1이전 세대 모델
MiniMax-M2.1-highspeedM2.1의 고속 변형
MiniMax-M2기본 모델

모델 매핑

모델 매핑은 Anthropic 모델 이름을 MiniMax 동등 모델로 변환합니다:

model_mapping:
# Claude Opus -> MiniMax-M2.5 (플래그십)
"claude-opus-4-6": "MiniMax-M2.5"

# Claude Sonnet -> MiniMax-M2.5-highspeed (빠른, 고품질)
"claude-sonnet-4-5-20250514": "MiniMax-M2.5-highspeed"
"claude-sonnet-4-5": "MiniMax-M2.5-highspeed"

# Claude Haiku -> MiniMax-M2.1-highspeed (빠른, 경제적)
"claude-haiku-4-5-20251001": "MiniMax-M2.1-highspeed"
"claude-haiku-4-5": "MiniMax-M2.1-highspeed"
[model_mapping]
# Claude Opus -> MiniMax-M2.5 (플래그십)
"claude-opus-4-6" = "MiniMax-M2.5"

# Claude Sonnet -> MiniMax-M2.5-highspeed (빠른, 고품질)
"claude-sonnet-4-5-20250514" = "MiniMax-M2.5-highspeed"
"claude-sonnet-4-5" = "MiniMax-M2.5-highspeed"

# Claude Haiku -> MiniMax-M2.1-highspeed (빠른, 경제적)
"claude-haiku-4-5-20251001" = "MiniMax-M2.1-highspeed"
"claude-haiku-4-5" = "MiniMax-M2.1-highspeed"

Model Mapping

model_mapping 필드는 들어오는 모델 이름을 프로바이더별 모델로 변환합니다:

providers:
- name: "zai"
  type: "zai"
  model_mapping:
    # 형식: "들어오는-모델": "프로바이더-모델"
    "claude-sonnet-4-5-20250514": "GLM-4.7"
    "claude-sonnet-4-5": "GLM-4.7"
[[providers]]
name = "zai"
type = "zai"

[providers.model_mapping]
# Format: "incoming-model" = "provider-model"
"claude-sonnet-4-5-20250514" = "GLM-4.7"
"claude-sonnet-4-5" = "GLM-4.7"

Claude Code가 보낼 때:

{"model": "claude-sonnet-4-5-20250514", ...}

CC-Relay는 Z.AI로 라우팅:

{"model": "GLM-4.7", ...}

매핑 팁

  1. 버전 접미사 포함: claude-sonnet-4-5claude-sonnet-4-5-20250514 둘 다 매핑
  2. 컨텍스트 길이 고려: 유사한 기능을 가진 모델 매칭
  3. 품질 테스트: 출력 품질이 요구 사항에 맞는지 확인

멀티 프로바이더 설정

장애 조치, 비용 최적화 또는 부하 분산을 위해 여러 프로바이더를 설정합니다:

providers:
# 기본: Anthropic (최고 품질)
- name: "anthropic"
  type: "anthropic"
  enabled: true
  keys:
    - key: "${ANTHROPIC_API_KEY}"
      priority: 2  # 먼저 시도

# 보조: Z.AI (비용 효율적)
- name: "zai"
  type: "zai"
  enabled: true
  keys:
    - key: "${ZAI_API_KEY}"
      priority: 1  # 폴백

# 3차: Ollama (로컬, 무료)
- name: "ollama"
  type: "ollama"
  enabled: true
  keys:
    - key: "ollama"
      priority: 0  # 최후의 수단

routing:
strategy: failover  # 우선순위 순서로 프로바이더 시도
# Primary: Anthropic (highest quality)
[[providers]]
name = "anthropic"
type = "anthropic"
enabled = true

[[providers.keys]]
key = "${ANTHROPIC_API_KEY}"
priority = 2  # Tried first

# Secondary: Z.AI (cost-effective)
[[providers]]
name = "zai"
type = "zai"
enabled = true

[[providers.keys]]
key = "${ZAI_API_KEY}"
priority = 1  # Fallback

# Tertiary: Ollama (local, free)
[[providers]]
name = "ollama"
type = "ollama"
enabled = true

[[providers.keys]]
key = "ollama"
priority = 0  # Last resort

[routing]
strategy = "failover"  # Try providers in priority order

이 설정으로:

  1. 요청이 먼저 Anthropic으로 (우선순위 2)
  2. Anthropic 실패 시 (429, 5xx), Z.AI 시도 (우선순위 1)
  3. Z.AI 실패 시, Ollama 시도 (우선순위 0)

더 많은 옵션은 라우팅 전략을 참조하세요.

문제 해결

연결 거부 (Ollama)

증상: Ollama 연결 시 connection refused

원인:

  • Ollama가 실행 중이 아님
  • 잘못된 포트
  • Docker 네트워킹 문제

해결책:

# Ollama 실행 중인지 확인
ollama list

# 포트 확인
curl http://localhost:11434/api/version

# Docker의 경우 호스트 게이트웨이 사용
base_url: "http://host.docker.internal:11434"

인증 실패 (Z.AI)

증상: Z.AI에서 401 Unauthorized

원인:

  • 잘못된 API 키
  • 환경 변수 미설정
  • 키 미활성화

해결책:

# 환경 변수 확인
echo $ZAI_API_KEY

# 키 직접 테스트
curl -X POST https://api.z.ai/api/anthropic/v1/messages \
  -H "x-api-key: $ZAI_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model":"GLM-4.7","max_tokens":10,"messages":[{"role":"user","content":"Hi"}]}'

모델을 찾을 수 없음

증상: model not found 오류

원인:

  • 모델이 models 목록에 설정되지 않음
  • model_mapping 항목 누락
  • 모델 미설치 (Ollama)

해결책:

# 모델이 목록에 있는지 확인
models:
- "GLM-4.7"

# 매핑이 존재하는지 확인
model_mapping:
"claude-sonnet-4-5": "GLM-4.7"
# Ensure model is listed
models = ["GLM-4.7"]

# Ensure mapping exists
[model_mapping]
"claude-sonnet-4-5" = "GLM-4.7"

Ollama의 경우 모델이 설치되어 있는지 확인:

ollama list
ollama pull qwen3:32b

느린 응답 (Ollama)

증상: Ollama에서 매우 느린 응답

원인:

  • 하드웨어에 비해 모델이 너무 큼
  • GPU 미사용
  • RAM 부족

해결책:

  • 더 작은 모델 사용 (qwen3:32b 대신 qwen3:8b)
  • GPU 활성화 확인: ollama run qwen3:8b --verbose
  • 추론 중 메모리 사용량 확인

다음 단계