✨ 팀이 모델을 추가하도록 허용하기

✨ 팀이 모델을 추가하도록 허용하기 (Allow Teams to Add Models)

팀이 프로젝트에 자신만의 모델/키를 추가하도록 허용하는 방법을 알려드릴게요. 이렇게 하면 팀이 보내는 모든 OpenAI 호출이 팀 소유의 OpenAI 키를 사용하게 돼요. 자체 파인튜닝한 모델을 호출하고 싶은 팀에게 유용하답니다.

출처: 문서

본문

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

/model/add 엔드포인트에 팀 ID 지정하기 (Specify Team ID in /model/add endpoint)

# Authorization: *** Team API Key (has same 'team_id' as below)
curl -L -X POST 'http://0.0.0.0:4000/model/new' \
-H 'Authorization: Bearer sk-***...TAmA' \
-H 'Content-Type: application/json' \
-d '{
  "model_name": "my-team-model", # 👈 Call LiteLLM with this model name
  "litellm_params": {
    "model": "openai/gpt-5.6-terra",
    "custom_llm_provider": "openai",
    "api_key": "******ccb07",
    "api_base": "https://my-azure-endpoint.openai.azure.com",
    "api_version": "2023-12-01-preview"
  },
  "model_info": {
    "team_id": "e59e2671-a064-436a-a0fa-16ae96e5a0a1" # 👈 Specify the team ID it belongs to
  }
}'

테스트해 보기! (Test it!)

# Authorization: *** Team API Key
curl -L -X POST 'http://0.0.0.0:4000/v1/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-***...TAmA' \
-d '{
  "model": "my-team-model", # 👈 team model name
  "messages": [
    {
      "role": "user",
      "content": "What's the weather like in Boston today?"
    }
  ]
}'

디버깅 (Debugging)

'model_name'을 찾을 수 없음

팀 테이블에 모델 별칭이 있는지 확인하세요.

curl -L -X GET 'http://localhost:4000/team/info?team_id=e59e2671-a064-436a-a0fa-16ae96e5a0a1' \
-H 'Authorization: Bearer sk-***...TAmA' \

예상 응답 (Expected Response):

{
    "team_id": "e59e2671-a064-436a-a0fa-16ae96e5a0a1",
    "team_info": {
        ...,
        "litellm_model_table": {
            "model_aliases": {
                "my-team-model": # 👈 public model name
                    "model_name_e59e2671-a064-436a-a0fa-16ae96e5a0a1_e81c9286-2195-4bd9-81e1-cf393788a1a0" # 👈 internally generated model name (used to ensure uniqueness)
            },
            "created_by": "default_user_id",
            "updated_by": "default_user_id"
        }
    }
}

더 알아보기 (Learn more)