OpenInference 핵심 기능 — Python 계측 패키지

OpenInference 핵심 기능 — Python

OpenInference의 Python 계측은 LLM 애플리케이션에서 트레이스를 수집하는 프레임워크예요. '계측(instrumentation)'은 애플리케이션에 관측 코드를 추가하는 일이고, OpenInference는 인기 SDK·프레임워크용 인스트루멘터를 제공해요.

핵심 Python 패키지

패키지 설명
openinference-semantic-conventions LLM 앱 추적용 시맨틱 컨벤션
openinference-instrumentation 계측용 재사용 유틸·데코레이터·설정·헬퍼

프레임워크별 계측 (일부)

  • openinference-instrumentation-openai — OpenAI SDK
  • openinference-instrumentation-openai-agents — OpenAI Agents SDK
  • openinference-instrumentation-langchain — LangChain
  • openinference-instrumentation-llama-index — LlamaIndex
  • openinference-instrumentation-dspy — DSPy
  • openinference-instrumentation-anthropic — Anthropic
  • openinference-instrumentation-crewai — CrewAI
  • openinference-instrumentation-autogen-agentchat — Microsoft Autogen AgentChat
  • openinference-instrumentation-pydantic-ai — PydanticAI
  • openinference-instrumentation-mcp — MCP
  • openinference-instrumentation-ollama — Ollama
  • openinference-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+)

더 알아보기