Athina AI
Athina AI
Athina는 프로덕션 모니터링·평가 플랫폼이에요. 여기에서 샌드박스를 시도해 볼 수 있어요. Athina를 Ragas 메트릭과 함께 사용하면 프로덕션 로그에 대한 eval을 실행하고, 프로덕션 데이터에 대한 세밀한 모델 성능 메트릭을 얻을 수 있어요.
출처: 문서
본문
프로덕션 로그에서 Ragas 메트릭
예를 들어 다음과 같은 인사이트를 시각적으로 얻을 수 있어요.
- 고객 id nike-usa 의 환불 관련 쿼리에 대한 AnswerRelevancy 점수는 얼마인가요
- catalog_answerer/v3 프롬프트와 gpt-3.5-turbo 모델을 사용하는 제품 카탈로그 쿼리에 대한 Faithfulness 점수는 얼마인가요
▷ Athina를 프로그래밍 방식으로 실행
Athina를 사용해 Ragas evals을 프로그래밍 방식으로 실행하면, 결과를 Athina의 UI에서 이렇게 볼 수 있어요 👇
- Athina의 Python SDK를 설치하세요.
pip install athina
-
app.athina.ai 에서 계정을 만드세요. 가입하면 API 키를 받을 수 있어요.
-
따라 할 수 있는 샘플 노트북이 여기 있어요: https://github.com/athina-ai/athina-evals/blob/main/examples/ragas.ipynb
-
코드를 실행하세요.
import os
from athina.evals import (
RagasAnswerCorrectness,
RagasAnswerRelevancy,
RagasContextRelevancy,
RagasFaithfulness,
)
from athina.loaders import RagasLoader
from athina.keys import AthinaApiKey, OpenAiApiKey
from athina.runner.run import EvalRunner
import pandas as pd
# Set your API keys
OpenAiApiKey.set_key(os.getenv("OPENAI_API_KEY"))
AthinaApiKey.set_key(os.getenv("ATHINA_API_KEY"))
# Load your dataset from a dictionary, json, or csv: https://docs.athina.ai/evals/loading_data
dataset = RagasLoader().load_json("raw_data.json")
# Configure the eval suite
eval_model = "gpt-3.5-turbo"
eval_suite = [
RagasAnswerCorrectness(),
RagasFaithfulness(),
RagasContextRelevancy(),
RagasAnswerRelevancy(),
]
# Run the evaluation suite
batch_eval_result = EvalRunner.run_suite(
evals=eval_suite,
data=dataset,
max_parallel_evals=1, # If you increase this, you may run into rate limits
)
pd.DataFrame(batch_eval_result)
▷ 프로덕션 로그에서 Ragas를 자동으로 실행하도록 구성
프로덕션 추론을 Athina에 로깅하고 있다면, Ragas 메트릭이 프로덕션 로그에 대해 자동으로 실행되도록 구성할 수 있어요.
- Athina 대시보드로 이동
- Evals 페이지를 엽니다(왼쪽의 번개 아이콘)
- 오른쪽 위의 "New Eval" 버튼 클릭
- Ragas 탭 선택
- 구성할 eval을 선택
Athina에 대해 더 알아보기
- 웹사이트: https://athina.ai
- 문서: https://docs.athina.ai
- GitHub 라이브러리: https://github.com/athina-ai/athina-evals
- 샌드박스: https://demo.athina.ai