Google Cloud Storage

Google Cloud Storage (GCS Bucket)

LLM 로그를 Google Cloud Storage Buckets로 보내는 방법을 알려드릴게요. LiteLLM 프록시가 gcs_bucket 콜백을 통해 응답 로그를 GCS 버킷에 저장해요.

출처: 문서

본문

엔터프라이즈 기능 — 이 기능은 LiteLLM Enterprise 라이선스가 필요해요. 30일 무료 체험을 시작하거나 데모 예약을 해 보세요. Enterprise에 포함된 것을 확인해 보세요.

사용법 (Usage)

  1. gcs_bucket을 LiteLLM Config.yaml에 추가해 주세요.
model_list:
- litellm_params:
    api_base: https://openai-function-calling-workers.tasslexyz.workers.dev/
    api_key: my-fake-key
    model: openai/my-fake-model
  model_name: fake-openai-endpoint

litellm_settings:
  callbacks: ["gcs_bucket"] # 👈 KEY CHANGE
  1. 필수 환경 변수를 설정해 주세요.
GCS_BUCKET_NAME="<your-gcs-bucket-name>"
GCS_PATH_SERVICE_ACCOUNT="/Users/ishaanjaffer/Downloads/adroit-crow-413218-a956eef1a2a8.json" # Add path to service account.json
  1. 프록시를 시작해 주세요.
litellm --config /path/to/config.yaml
  1. 테스트해 보세요!
curl --location 'http://0.0.0.0:4000/chat/completions' \
--header 'Content-Type: application/json' \
--data ' {
      "model": "fake-openai-endpoint",
      "messages": [
        {
          "role": "user",
          "content": "what llm are you"
        }
      ],
    }
'

GCS 버킷의 예상 로그 (Expected Logs on GCS Buckets)

GCS 버킷에 기록되는 필드 (Fields Logged on GCS Buckets)

표준 로깅 객체가 GCS 버킷에 기록돼요

Google Cloud Console에서 service_account.json 받기 (Getting service_account.json from Google Cloud Console)

  1. Google Cloud Console로 이동
  2. IAM & Admin 검색
  3. Service Accounts 클릭
  4. Service Account 선택
  5. 'Keys' → Add Key → Create New Key → JSON 클릭
  6. JSON 파일을 저장하고 경로를 GCS_PATH_SERVICE_ACCOUNT에 추가

지원 및 창업자와 소통 (Support & Talk to Founders)

더 알아보기 (Learn more)