OpenInference 핵심 기능 — Python 계측 패키지
OpenInference 핵심 기능 — Python
OpenInference의 Python 계측은 LLM 애플리케이션에서 트레이스를 수집하는 프레임워크예요. '계측(instrumentation)'은 애플리케이션에 관측 코드를 추가하는 일이고, OpenInference는 인기 SDK·프레임워크용 인스트루멘터를 제공해요.
핵심 Python 패키지
| 패키지 | 설명 |
|---|---|
openinference-semantic-conventions |
LLM 앱 추적용 시맨틱 컨벤션 |
openinference-instrumentation |
계측용 재사용 유틸·데코레이터·설정·헬퍼 |
프레임워크별 계측 (일부)
openinference-instrumentation-openai— OpenAI SDKopeninference-instrumentation-openai-agents— OpenAI Agents SDKopeninference-instrumentation-langchain— LangChainopeninference-instrumentation-llama-index— LlamaIndexopeninference-instrumentation-dspy— DSPyopeninference-instrumentation-anthropic— Anthropicopeninference-instrumentation-crewai— CrewAIopeninference-instrumentation-autogen-agentchat— Microsoft Autogen AgentChatopeninference-instrumentation-pydantic-ai— PydanticAIopeninference-instrumentation-mcp— MCPopeninference-instrumentation-ollama— Ollamaopeninference-instrumentation-litellm— LiteLLM
스팬 프로세서
다른 계측 라이브러리의 데이터를 정규화·변환하는 스팬 프로세서도 제공해요.
openinference-instrumentation-openlit— OpenLIT 트레이스용openinference-instrumentation-openllmetry— OpenLLMetry(Traceloop) 트레이스용
사용 예시 (OpenAI)
from openinference.instrumentation.openai import OpenAIInstrumentor
OpenAIInstrumentor().instrument()
이후 재생성한 호출의 스팬이 OpenInference 포맷으로 수집돼요. 예제는 각 인스트루멘터의 examples/ 디렉터리에서 확인할 수 있어요.
지원 언어
Python 외에도 JavaScript, Java, Go 계측을 제공해요.
- Java:
openinference-instrumentation-langchain4j,openinference-instrumentation-springAI, annotation 기반(@Chain,@LLM,@Tool,@Agent) 수동 추적 - Go: OpenAI·Anthropic Go SDK 계측 (Go 1.25+)