neuron-explorer
Qwen3.5‑4B 전용 조향형 뉴런 탐색기, 모든 MLP 뉴런을 밀어 결과를 보관·탐색
🪢 Langfuse Python SDK
개발 도구Python · JinjaGitHub @langfuse직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗[!IMPORTANT] The SDK was rewritten in v4 and released in March 2026. Refer to the v4 migration guide for instructions on updating your code.
This is the latest Langfuse Python SDK (v4, OpenTelemetry). The legacy v2 client API (
trace(),span(),generation(),api.trace.list) is deprecated. Do not use it for new instrumentation.Latest Python SDK (OpenTelemetry):
pip install langfuse. Useget_client()+start_as_current_observation/@observe. Prompts/datasets/scores: the samelangfusepackage. Docs: https://langfuse.com/docs/observability/sdk/overview. Upgrade: v2 to v3, v3 to v4.Query traces with Observations API v2 (
GET /api/public/v2/observations, API reference), notGET /api/public/traces/api.trace.list.Data freshness: the only real-time path is OpenTelemetry ingestion (this SDK at
langfuse>= 4.7.0, or any OTel exporter sendingx-langfuse-ingestion-version: 4) combined with the Observations API v2 and Metrics API v2. All other GET APIs from all SDK versions can be up to 10 minutes behind.
The Langfuse Python SDK covers the full platform: observability/tracing (OpenTelemetry-based, with OpenAI and LangChain integrations), datasets & experiments (offline evaluation and regression testing of prompt/model changes, including CI via GitHub Actions), LLM-as-a-judge and custom evaluations/scores, prompt management, and a full REST API client.
pip install langfuse
# env: LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_BASE_URL
from langfuse import get_client
langfuse = get_client()
# Create a span using a context manager
with langfuse.start_as_current_observation(as_type="span", name="process-request") as span:
# Your processing logic here
span.update(output="Processing complete")
# Create a nested generation for an LLM call
with langfuse.start_as_current_observation(as_type="generation", name="llm-response", model="gpt-5.6") as generation:
# Your LLM call logic here
generation.update(output="Generated response")
# All spans are automatically closed when exiting their context blocks
# Flush events in short-lived applications
langfuse.flush()