716 Views
January 28, 25
スライド概要
Langfuse Night #1 の発表資料
https://connpass.com/event/340099/
温かい目で見守ってください
目指せ全問正解! 第1回 Langfuse Quiz 大会 〜 そのTraceのLatencyはいくらだい?編 〜 waiwai @ystkfujii
目指せ 2 問正解! 第1回 Langfuse Quiz 大会 〜 そのTraceのLatencyはいくらだい?編 〜 waiwai @ystkfujii
自己紹介 ふじい です ● 職業: ○ ● 生息地: ○ ● / :@ystkfujii インフラ成分多めの バックエンドエンジニア Cloud Native / Kubernetes 関連のコミュニティ 最近の活動:
Langfuse: Traceとは LLMアプリケーションの一連のイベントをまとめたもの 全体で4.38秒 トレースの作成方法 [1] ● Python Decorator: @observeデコレータ ● Low-Level SDK: ● Integration: Traceの構成要素を手動で設定 / とか [1] https://langfuse.com/docs/get-started
Langfuse: Traceとは LLMアプリケーションの一連のイベントをまとめたもの 全体で4.38秒 トレースの作成方法 [1] ● Python Decorator: @observeデコレータ ● Low-Level SDK: ● Integration: Traceの構成要素を手動で設定 / とか 今日やること: Python Decoratorを使って作成したトレースの 全体の処理時間 (Latency)を当てろ! [1] https://langfuse.com/docs/get-started
Langfuse Quiz #1: TraceのLatencyはいくらだい? A:5秒くらい B:3秒くらい C:2秒くらい D:0秒くらい
Langfuse Quiz #1: TraceのLatencyはいくらだい? A:5秒くらい B:3秒くらい C:2秒くらい Traceの詳細はこんな感じ D:0秒くらい
Langfuse Quiz #2: TraceのLatencyはいくらだい? A:5秒くらい B:3秒くらい C:2秒くらい D:0秒くらい
Langfuse Quiz #2: TraceのLatencyはいくらだい? A:5秒くらい B:3秒くらい C:2秒くらい Traceの詳細はこんな感じ D:0秒くらい
Langfuse Quiz #2: TraceのLatencyはいくらだい? A:5秒くらい そもそも Latencyって B:3秒くらい どうやって計算してるの? �� C:2秒くらい Traceの詳細はこんな感じ D:0秒くらい
Latencyについて ▪Tracing Data Model[1] Trace 1 n Observation Event Span Generation [1] https://langfuse.com/docs/tracing-data-model [2] https://github.com/langfuse/langfuse/blob/v3.14.0/packages/shared/prisma/database.svg [3] https://github.com/langfuse/langfuse/blob/v3.14.0/packages/shared/src/server/services/traces-ui-table-service.ts#L363
Latencyについて ▪Tracing Data Model[1] ▪Observationsテーブル [2] id trace_id type Trace 1 input output promptTokens start_time end_time など n Observation Event Span Generation [1] https://langfuse.com/docs/tracing-data-model [2] https://github.com/langfuse/langfuse/blob/v3.14.0/packages/shared/prisma/database.svg [3] https://github.com/langfuse/langfuse/blob/v3.14.0/packages/shared/src/server/services/traces-ui-table-service.ts#L363
Latencyについて ▪Tracing Data Model[1] ▪Observationsテーブル [2] id trace_id type Trace 1 start_time input end_time output promptTokens など n ▪Latencyの計算 [3] Observation start_time Observation Event Span Generation Trace Observation … Observation Latency end_time [1] https://langfuse.com/docs/tracing-data-model [2] https://github.com/langfuse/langfuse/blob/v3.14.0/packages/shared/prisma/database.svg [3] https://github.com/langfuse/langfuse/blob/v3.14.0/packages/shared/src/server/services/traces-ui-table-service.ts#L363
Latencyについて ▪Tracing Data Model[1] ▪Observationsテーブル [2] つまり、、、 Trace 1 Observationが無ければ n Latencyを計算できない Observation Event �� Span Generation id trace_id type start_time input end_time output promptTokens など ▪Latencyの計算 [3] start_time Observation Trace Observation … Observation Latency end_time [1] https://langfuse.com/docs/tracing-data-model [2] https://github.com/langfuse/langfuse/blob/v3.14.0/packages/shared/prisma/database.svg [3] https://github.com/langfuse/langfuse/blob/v3.14.0/packages/shared/src/server/services/traces-ui-table-service.ts#L363
Quiz Explanation ▪Quiz #1 ▪Quiz #2 Trace SPAN ( Observation ) Trace main hello_world hello_world Observationがある ので、latencyが計算可能 Observationが無い ので、latencyが計算不可
仕様ではなく、バグです https://github.com/langfuse/langfuse/issues/4773