콘텐츠로 이동

설정 예제

다중 백엔드 설정

# 엔터프라이즈 다중 백엔드 설정
server:
  bind_address: "0.0.0.0:8080"
  workers: 8
  connection_pool_size: 400

backends:
  # 기본 OpenAI GPT 모델
  - name: "openai-primary"
    url: "https://api.openai.com"
    weight: 5
    models: ["gpt-4", "gpt-3.5-turbo"]
    retry_override:
      max_attempts: 3
      initial_delay: "500ms"
      max_delay: "10s"
      backoff_multiplier: 2.0
      jitter: true
      retryable_status_codes: [429, 502, 503, 504]
      retryable_errors: [ConnectionError, TimeoutError]
      timeout: "30s"

  # 보조 Azure OpenAI
  - name: "azure-openai"
    url: "https://your-resource.openai.azure.com"
    weight: 3
    models: ["gpt-4", "gpt-35-turbo"]

  # 오픈 모델을 위한 로컬 Ollama
  - name: "local-ollama"
    url: "http://ollama:11434"
    weight: 2
    models: ["llama2", "mistral", "codellama"]

  # vLLM 배포
  - name: "vllm-cluster"
    url: "http://vllm-service:8000"
    weight: 4
    models: ["meta-llama/Llama-2-7b-chat-hf"]

health_checks:
  interval: "45s"
  timeout: "15s"
  unhealthy_threshold: 3
  healthy_threshold: 2
  endpoint: "/health"


retry:
  max_attempts: 4
  initial_delay: "100ms"
  max_delay: "10s"
  backoff_multiplier: 2.0
  jitter: true
  retryable_status_codes: [429, 502, 503, 504]
  retryable_errors: [ConnectionError, TimeoutError]
  timeout: "30s"

logging:
  level: "info"
  format: "json"

고성능 설정

# 높은 처리량 시나리오에 최적화
server:
  bind_address: "0.0.0.0:8080"
  workers: 16                     # 높은 워커 수
  connection_pool_size: 1000      # 큰 연결 풀

backends:
  - name: "fast-backend-1"
    url: "http://backend1:8000"
    weight: 1
  - name: "fast-backend-2"
    url: "http://backend2:8000"
    weight: 1
  - name: "fast-backend-3"
    url: "http://backend3:8000"
    weight: 1

health_checks:
  interval: "30s"
  timeout: "5s"                   # 빠른 타임아웃
  unhealthy_threshold: 2          # 빠른 실패
  healthy_threshold: 1            # 빠른 복구
  endpoint: "/health"


retry:
  max_attempts: 2                 # 적은 재시도
  initial_delay: "50ms"           # 빠른 재시도
  max_delay: "5s"
  backoff_multiplier: 2.0
  jitter: true
  retryable_status_codes: [429, 502, 503, 504]
  retryable_errors: [ConnectionError, TimeoutError]
  timeout: "15s"

logging:
  level: "warn"                   # 성능을 위한 최소 로깅
  format: "json"

개발 설정

# 개발자 친화적 설정
server:
  bind_address: "127.0.0.1:8080"  # localhost만
  workers: 2                      # 개발용 적은 워커
  connection_pool_size: 20        # 작은 풀

backends:
  - name: "local-ollama"
    url: "http://localhost:11434"
    weight: 1

health_checks:
  interval: "10s"                 # 빠른 피드백을 위한 잦은 확인
  timeout: "3s"
  unhealthy_threshold: 2
  healthy_threshold: 1
  endpoint: "/health"


retry:
  max_attempts: 1                 # 디버깅을 위한 최소 재시도
  initial_delay: "100ms"
  max_delay: "1s"
  backoff_multiplier: 2.0
  jitter: true
  retryable_status_codes: [429, 502, 503, 504]
  retryable_errors: [ConnectionError, TimeoutError]
  timeout: "5s"

logging:
  level: "debug"                  # 상세 로깅
  format: "pretty"                # 사람이 읽기 쉬운 형식