LLM 벤치마크하기

LLM 벤치마크하기

주어진 질문에 대해 LLM을 쉽게 벤치마크할 수 있어요. 다음을 확인해 보세요.

  • 응답(Responses)

  • 응답 비용(Response Cost)

  • 응답 시간(Response Time)

출처: 문서

본문

벤치마크 출력

설정:

git clone https://github.com/BerriAI/litellm

litellm/cookbook/benchmark 디렉터리로 이동해요.

여기에 있어요:

https://github.com/BerriAI/litellm/tree/main/cookbook/benchmark

cd litellm/cookbook/benchmark

의존성 설치

uv add litellm click tqdm tabulate termcolor

구성 - benchmark.py에서 LLM API 키 + LLM 설정

benchmark/benchmark.py에서 LLM, LLM API 키, 질문을 선택해요.

지원되는 LLM: https://docs.litellm.ai/docs/providers

# Define the list of models to benchmarkmodels = ['gpt-5.6-luna', 'claude-sonnet-5']# Enter LLM API keysos.environ['OPENAI_API_KEY'] = ""os.environ['ANTHROPIC_API_KEY'] = ""# List of questions to benchmark (replace with your questions)questions = [    "When will BerriAI IPO?",    "When will LiteLLM hit $100M ARR?"]

benchmark.py 실행

python3 benchmark.py

예상 출력

Running question: When will BerriAI IPO? for model: claude-2: 100%|████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:131-on-1 session with Krrish and Ishaan, the founders, to discuss any issues, provide feedback, or explore how we can improve LiteLLM for you.

더 알아보기 (Learn more)