ai-agent-book 精选快照(<2MB 代码与文档,来自 github.com/bojieli/ai-agent-book)
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,426 @@
|
||||
{
|
||||
"model": "kimi-k2.5",
|
||||
"pricing": {
|
||||
"input": 0.5911688312,
|
||||
"cached": 0.1034545455,
|
||||
"output": 3.1036363636
|
||||
},
|
||||
"scenarios": [
|
||||
{
|
||||
"key": "naive",
|
||||
"name": "A 朴素(无缓存/无压缩)",
|
||||
"total_cost": 0.0152468353252392,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0115224716889192,
|
||||
"cached_input_cost": 0.0,
|
||||
"output_cost": 0.00372436363632,
|
||||
"uncached_input_tokens": 19491,
|
||||
"cached_input_tokens": 0,
|
||||
"output_tokens": 1200,
|
||||
"tool_ctx_tokens": 10749
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.0019058544156549,
|
||||
"p50": 0.0019094753247440002,
|
||||
"p95": 0.0025698109091944,
|
||||
"p99": 0.0025698109091944,
|
||||
"max": 0.0025698109091944
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1013,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 120,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 2.287337064743042
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1670,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 120,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 3.4959402084350586
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2008,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 5.752177000045776
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2390,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1482,
|
||||
"latency_s": 3.8040597438812256
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2682,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1585,
|
||||
"latency_s": 6.000391006469727
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2970,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1693,
|
||||
"latency_s": 5.413041353225708
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3251,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1779,
|
||||
"latency_s": 5.660830974578857
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3507,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1847,
|
||||
"latency_s": 5.281260013580322
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "kv",
|
||||
"name": "KV 仅缓存(稳定前缀/不压缩)",
|
||||
"total_cost": 0.0079609602864777,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0029623470131432,
|
||||
"cached_input_cost": 0.0014759860006485,
|
||||
"output_cost": 0.003522627272686,
|
||||
"uncached_input_tokens": 5011,
|
||||
"cached_input_tokens": 14267,
|
||||
"output_tokens": 1135,
|
||||
"tool_ctx_tokens": 10749
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.0009951200358097126,
|
||||
"p50": 0.001072025558548,
|
||||
"p95": 0.0011735883637072,
|
||||
"p99": 0.0011735883637072,
|
||||
"max": 0.0011735883637072
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 955,
|
||||
"cached_tokens": 955,
|
||||
"completion_tokens": 129,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 5.202546119689941
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1620,
|
||||
"cached_tokens": 512,
|
||||
"completion_tokens": 145,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 4.699679136276245
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1990,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 4.436970949172974
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2375,
|
||||
"cached_tokens": 1536,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1482,
|
||||
"latency_s": 5.637408018112183
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2663,
|
||||
"cached_tokens": 2048,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1585,
|
||||
"latency_s": 4.351202964782715
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2953,
|
||||
"cached_tokens": 2304,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1693,
|
||||
"latency_s": 5.36053204536438
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3233,
|
||||
"cached_tokens": 2816,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1779,
|
||||
"latency_s": 4.889960765838623
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3489,
|
||||
"cached_tokens": 3072,
|
||||
"completion_tokens": 61,
|
||||
"tool_ctx_tokens": 1847,
|
||||
"latency_s": 1.9250061511993408
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "compress",
|
||||
"name": "仅压缩(前缀不稳定/摘要)",
|
||||
"total_cost": 0.0132817901303144,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.009309135584906399,
|
||||
"cached_input_cost": 0.0,
|
||||
"output_cost": 0.003972654545408001,
|
||||
"uncached_input_tokens": 15747,
|
||||
"cached_input_tokens": 0,
|
||||
"output_tokens": 1280,
|
||||
"tool_ctx_tokens": 6036
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.0016602237662893,
|
||||
"p50": 0.0017338981818776,
|
||||
"p95": 0.00189765194812,
|
||||
"p99": 0.00189765194812,
|
||||
"max": 0.00189765194812
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1012,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 5.470736980438232
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1710,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 4.1132972240448
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2093,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 3.5907950401306152
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2227,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1231,
|
||||
"latency_s": 3.2491540908813477
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2021,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 780,
|
||||
"latency_s": 7.461982250213623
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2114,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 677,
|
||||
"latency_s": 4.925306081771851
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2200,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 486,
|
||||
"latency_s": 5.416359186172485
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2370,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 499,
|
||||
"latency_s": 4.96558403968811
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "both",
|
||||
"name": "B 优化(KV缓存+压缩)",
|
||||
"total_cost": 0.0086632688576729,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0041033028573592,
|
||||
"cached_input_cost": 0.0008138769094485001,
|
||||
"output_cost": 0.0037460890908652,
|
||||
"uncached_input_tokens": 6941,
|
||||
"cached_input_tokens": 7867,
|
||||
"output_tokens": 1207,
|
||||
"tool_ctx_tokens": 6036
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.0010829086072091125,
|
||||
"p50": 0.0011068749610916,
|
||||
"p95": 0.0013616982857848,
|
||||
"p99": 0.0013616982857848,
|
||||
"max": 0.0013616982857848
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 955,
|
||||
"cached_tokens": 955,
|
||||
"completion_tokens": 116,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 2.2258410453796387
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1607,
|
||||
"cached_tokens": 512,
|
||||
"completion_tokens": 131,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 4.5919647216796875
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1963,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 7.6671669483184814
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2097,
|
||||
"cached_tokens": 768,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1231,
|
||||
"latency_s": 5.431225061416626
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1887,
|
||||
"cached_tokens": 768,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 780,
|
||||
"latency_s": 5.2519941329956055
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1988,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 677,
|
||||
"latency_s": 4.7071919441223145
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2073,
|
||||
"cached_tokens": 1280,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 486,
|
||||
"latency_s": 5.377019882202148
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2238,
|
||||
"cached_tokens": 1536,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 499,
|
||||
"latency_s": 4.964300155639648
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,426 @@
|
||||
{
|
||||
"model": "kimi-k2.5",
|
||||
"pricing": {
|
||||
"input": 0.5911688312,
|
||||
"cached": 0.1034545455,
|
||||
"output": 3.1036363636
|
||||
},
|
||||
"scenarios": [
|
||||
{
|
||||
"key": "naive",
|
||||
"name": "A 朴素(无缓存/无压缩)",
|
||||
"total_cost": 0.0152468353252392,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0115224716889192,
|
||||
"cached_input_cost": 0.0,
|
||||
"output_cost": 0.00372436363632,
|
||||
"uncached_input_tokens": 19491,
|
||||
"cached_input_tokens": 0,
|
||||
"output_tokens": 1200,
|
||||
"tool_ctx_tokens": 10749
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.0019058544156549,
|
||||
"p50": 0.0019094753247440002,
|
||||
"p95": 0.0025698109091944,
|
||||
"p99": 0.0025698109091944,
|
||||
"max": 0.0025698109091944
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1013,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 120,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 2.287337064743042
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1670,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 120,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 3.4959402084350586
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2008,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 5.752177000045776
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2390,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1482,
|
||||
"latency_s": 3.8040597438812256
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2682,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1585,
|
||||
"latency_s": 6.000391006469727
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2970,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1693,
|
||||
"latency_s": 5.413041353225708
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3251,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1779,
|
||||
"latency_s": 5.660830974578857
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3507,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1847,
|
||||
"latency_s": 5.281260013580322
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "kv",
|
||||
"name": "KV 仅缓存(稳定前缀/不压缩)",
|
||||
"total_cost": 0.0079609602864777,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0029623470131432,
|
||||
"cached_input_cost": 0.0014759860006485,
|
||||
"output_cost": 0.003522627272686,
|
||||
"uncached_input_tokens": 5011,
|
||||
"cached_input_tokens": 14267,
|
||||
"output_tokens": 1135,
|
||||
"tool_ctx_tokens": 10749
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.0009951200358097126,
|
||||
"p50": 0.001072025558548,
|
||||
"p95": 0.0011735883637072,
|
||||
"p99": 0.0011735883637072,
|
||||
"max": 0.0011735883637072
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 955,
|
||||
"cached_tokens": 955,
|
||||
"completion_tokens": 129,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 5.202546119689941
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1620,
|
||||
"cached_tokens": 512,
|
||||
"completion_tokens": 145,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 4.699679136276245
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1990,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 4.436970949172974
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2375,
|
||||
"cached_tokens": 1536,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1482,
|
||||
"latency_s": 5.637408018112183
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2663,
|
||||
"cached_tokens": 2048,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1585,
|
||||
"latency_s": 4.351202964782715
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2953,
|
||||
"cached_tokens": 2304,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1693,
|
||||
"latency_s": 5.36053204536438
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3233,
|
||||
"cached_tokens": 2816,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1779,
|
||||
"latency_s": 4.889960765838623
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3489,
|
||||
"cached_tokens": 3072,
|
||||
"completion_tokens": 61,
|
||||
"tool_ctx_tokens": 1847,
|
||||
"latency_s": 1.9250061511993408
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "compress",
|
||||
"name": "仅压缩(前缀不稳定/摘要)",
|
||||
"total_cost": 0.0132817901303144,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.009309135584906399,
|
||||
"cached_input_cost": 0.0,
|
||||
"output_cost": 0.003972654545408001,
|
||||
"uncached_input_tokens": 15747,
|
||||
"cached_input_tokens": 0,
|
||||
"output_tokens": 1280,
|
||||
"tool_ctx_tokens": 6036
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.0016602237662893,
|
||||
"p50": 0.0017338981818776,
|
||||
"p95": 0.00189765194812,
|
||||
"p99": 0.00189765194812,
|
||||
"max": 0.00189765194812
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1012,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 5.470736980438232
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1710,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 4.1132972240448
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2093,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 3.5907950401306152
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2227,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1231,
|
||||
"latency_s": 3.2491540908813477
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2021,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 780,
|
||||
"latency_s": 7.461982250213623
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2114,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 677,
|
||||
"latency_s": 4.925306081771851
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2200,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 486,
|
||||
"latency_s": 5.416359186172485
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2370,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 499,
|
||||
"latency_s": 4.96558403968811
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "both",
|
||||
"name": "B 优化(KV缓存+压缩)",
|
||||
"total_cost": 0.0086632688576729,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0041033028573592,
|
||||
"cached_input_cost": 0.0008138769094485001,
|
||||
"output_cost": 0.0037460890908652,
|
||||
"uncached_input_tokens": 6941,
|
||||
"cached_input_tokens": 7867,
|
||||
"output_tokens": 1207,
|
||||
"tool_ctx_tokens": 6036
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.0010829086072091125,
|
||||
"p50": 0.0011068749610916,
|
||||
"p95": 0.0013616982857848,
|
||||
"p99": 0.0013616982857848,
|
||||
"max": 0.0013616982857848
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 955,
|
||||
"cached_tokens": 955,
|
||||
"completion_tokens": 116,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 2.2258410453796387
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1607,
|
||||
"cached_tokens": 512,
|
||||
"completion_tokens": 131,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 4.5919647216796875
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1963,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 7.6671669483184814
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2097,
|
||||
"cached_tokens": 768,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 1231,
|
||||
"latency_s": 5.431225061416626
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1887,
|
||||
"cached_tokens": 768,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 780,
|
||||
"latency_s": 5.2519941329956055
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1988,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 677,
|
||||
"latency_s": 4.7071919441223145
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2073,
|
||||
"cached_tokens": 1280,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 486,
|
||||
"latency_s": 5.377019882202148
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2238,
|
||||
"cached_tokens": 1536,
|
||||
"completion_tokens": 160,
|
||||
"tool_ctx_tokens": 499,
|
||||
"latency_s": 4.964300155639648
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"experiment": "7-9",
|
||||
"status": "incomplete",
|
||||
"generated_at_utc": "2026-07-29T22:31:57.870199+00:00",
|
||||
"run_dir": "chapter7/agent-cost-analysis/runs/exp7-9-kimi25-20260730-v2",
|
||||
"git_commit": "4a7f37cf278bd15948c409f14533017c4c7fbc29",
|
||||
"command": "python demo.py --live --scenario all --model kimi-k2.5 --save-trace TRACE --output REPORT",
|
||||
"provider_receipt_count": 32,
|
||||
"status_reasons": [
|
||||
"The real 2x2 run covers one eight-turn refund workflow; the manuscript asks for several representative task types and aggregate task-level p50/p95/p99.",
|
||||
"Reasoning-token usage and provider response IDs are recorded, but success-quality equivalence across optimizations is not independently judged.",
|
||||
"The 32 measured calls have unique provider response IDs; 16 cache-warmup calls were intentionally excluded from measured traces and do not have retained receipts."
|
||||
],
|
||||
"inputs": [
|
||||
{
|
||||
"path": "chapter7/agent-cost-analysis/agent.py",
|
||||
"bytes": 17109,
|
||||
"sha256": "30866b34ead7ff2897964aaf1e07867691102982971903f8a2a4172c48bfd718"
|
||||
},
|
||||
{
|
||||
"path": "chapter7/agent-cost-analysis/tracer.py",
|
||||
"bytes": 12309,
|
||||
"sha256": "fb673ac8f10ca037b6df3822e00e6cbb21b8381b731736fb1b2a30748e7226fe"
|
||||
},
|
||||
{
|
||||
"path": "chapter7/agent-cost-analysis/demo.py",
|
||||
"bytes": 13477,
|
||||
"sha256": "75dc27633829fe2a730c5654a38f6af90fd58eceee630dfa985e386fa536c104"
|
||||
},
|
||||
{
|
||||
"path": "chapter7/agent-cost-analysis/config.py",
|
||||
"bytes": 5701,
|
||||
"sha256": "0a92de4849994e74b28e3b5ad6c308cc154a2b984d8827f859b7f15d9fbbb463"
|
||||
},
|
||||
{
|
||||
"path": "chapter7/model-benchmark/campaign_config.json",
|
||||
"bytes": 8103,
|
||||
"sha256": "9a839ad907852798b35af5b4623814c343943ae1596a78d650d1a1affc93b17a"
|
||||
}
|
||||
],
|
||||
"artifacts": [
|
||||
{
|
||||
"path": "chapter7/agent-cost-analysis/runs/exp7-9-kimi25-20260730-v2/report.json",
|
||||
"bytes": 17810,
|
||||
"sha256": "92b0ee29c7df3dd28778d625fe699662dee56a5401141631ead450cd2ca37ace"
|
||||
},
|
||||
{
|
||||
"path": "chapter7/agent-cost-analysis/runs/exp7-9-kimi25-20260730-v2/trace.json",
|
||||
"bytes": 17810,
|
||||
"sha256": "92b0ee29c7df3dd28778d625fe699662dee56a5401141631ead450cd2ca37ace"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,554 @@
|
||||
{
|
||||
"model": "kimi-k2.5",
|
||||
"pricing": {
|
||||
"input": 0.5911688312,
|
||||
"cached": 0.1034545455,
|
||||
"output": 3.1036363636
|
||||
},
|
||||
"scenarios": [
|
||||
{
|
||||
"key": "naive",
|
||||
"name": "A 朴素(无缓存/无压缩)",
|
||||
"total_cost": 0.01574031350707,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0118080062343888,
|
||||
"cached_input_cost": 0.0,
|
||||
"output_cost": 0.0039323072726812,
|
||||
"uncached_input_tokens": 19974,
|
||||
"cached_input_tokens": 0,
|
||||
"output_tokens": 1267,
|
||||
"tool_ctx_tokens": 10749
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.00196753918838375,
|
||||
"p50": 0.0019544041559152,
|
||||
"p95": 0.0026135574027031996,
|
||||
"p99": 0.0026135574027031996,
|
||||
"max": 0.0026135574027031996
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1015,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 5.299084663391113,
|
||||
"response_id": "chatcmpl-6a6a7cb80695ae5455eab84a",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363640
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1706,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 147,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 5.079176902770996,
|
||||
"response_id": "chatcmpl-6a6a7cbd80925af8edb8bb5e",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363646
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2081,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 3.0797362327575684,
|
||||
"response_id": "chatcmpl-6a6a7cc24511d264b10f37dd",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363651
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2466,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1482,
|
||||
"latency_s": 3.4901974201202393,
|
||||
"response_id": "chatcmpl-6a6a7cc5edbcdbb3613f3353",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363654
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2753,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1585,
|
||||
"latency_s": 6.93122410774231,
|
||||
"response_id": "chatcmpl-6a6a7cc97f6a7380b55ebedb",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363658
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3048,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1693,
|
||||
"latency_s": 5.43744421005249,
|
||||
"response_id": "chatcmpl-6a6a7cd0d7374244555b9001",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363665
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3324,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1779,
|
||||
"latency_s": 5.579896926879883,
|
||||
"response_id": "chatcmpl-6a6a7cd56f58f5f62fa2981a",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363670
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3581,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1847,
|
||||
"latency_s": 5.334557056427002,
|
||||
"response_id": "chatcmpl-6a6a7cdb2e6a18d37452de21",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363676
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "kv",
|
||||
"name": "KV 仅缓存(稳定前缀/不压缩)",
|
||||
"total_cost": 0.0082537957670069,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0027956374027448,
|
||||
"cached_input_cost": 0.0015289547279445,
|
||||
"output_cost": 0.0039292036363176,
|
||||
"uncached_input_tokens": 4729,
|
||||
"cached_input_tokens": 14779,
|
||||
"output_tokens": 1266,
|
||||
"tool_ctx_tokens": 10749
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.0010317244708758625,
|
||||
"p50": 0.001053935792344,
|
||||
"p95": 0.0011930969351368,
|
||||
"p99": 0.0011930969351368,
|
||||
"max": 0.0011930969351368
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 955,
|
||||
"cached_tokens": 955,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 2.981578826904297,
|
||||
"response_id": "chatcmpl-6a6a7d043905097c262cd2d8",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363716
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1652,
|
||||
"cached_tokens": 512,
|
||||
"completion_tokens": 146,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 8.04120397567749,
|
||||
"response_id": "chatcmpl-6a6a7d07d5eb4229617017c7",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363719
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2023,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 6.327085256576538,
|
||||
"response_id": "chatcmpl-6a6a7d0f3905097c262cd2f5",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363727
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2408,
|
||||
"cached_tokens": 1792,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1482,
|
||||
"latency_s": 4.883957862854004,
|
||||
"response_id": "chatcmpl-6a6a7d15bb40cba1f65cc486",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363733
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2696,
|
||||
"cached_tokens": 2048,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1585,
|
||||
"latency_s": 5.0474817752838135,
|
||||
"response_id": "chatcmpl-6a6a7d1adc87cefde7ebcca2",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363738
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2986,
|
||||
"cached_tokens": 2560,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1693,
|
||||
"latency_s": 3.6142687797546387,
|
||||
"response_id": "chatcmpl-6a6a7d1f3905097c262cd332",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363743
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3266,
|
||||
"cached_tokens": 2816,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1779,
|
||||
"latency_s": 3.981088161468506,
|
||||
"response_id": "chatcmpl-6a6a7d233905097c262cd33e",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363747
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3522,
|
||||
"cached_tokens": 3072,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1847,
|
||||
"latency_s": 5.233341217041016,
|
||||
"response_id": "chatcmpl-6a6a7d27d5eb42296170182d",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363751
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "compress",
|
||||
"name": "仅压缩(前缀不稳定/摘要)",
|
||||
"total_cost": 0.0125982511692596,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0089390638965752,
|
||||
"cached_input_cost": 0.0,
|
||||
"output_cost": 0.0036591872726844,
|
||||
"uncached_input_tokens": 15121,
|
||||
"cached_input_tokens": 0,
|
||||
"output_tokens": 1179,
|
||||
"tool_ctx_tokens": 6036
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.00157478139615745,
|
||||
"p50": 0.0016801018182384,
|
||||
"p95": 0.0018338057143504,
|
||||
"p99": 0.0018338057143504,
|
||||
"max": 0.0018338057143504
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1010,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 121,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 3.843111276626587,
|
||||
"response_id": "chatcmpl-6a6a7d2c96a5dde81c3844dd",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363756
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1671,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 110,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 3.103135108947754,
|
||||
"response_id": "chatcmpl-6a6a7d3006fe5c9e72518409",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363760
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2002,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 5.465490102767944,
|
||||
"response_id": "chatcmpl-6a6a7d3384ead76d6951b7bb",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363763
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2136,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 149,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1231,
|
||||
"latency_s": 3.5718801021575928,
|
||||
"response_id": "chatcmpl-6a6a7d3880925af8edb8bcdd",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363769
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1916,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 780,
|
||||
"latency_s": 3.5103132724761963,
|
||||
"response_id": "chatcmpl-6a6a7d3cfa52c1b646ff684d",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363772
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2022,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 159,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 677,
|
||||
"latency_s": 3.597494125366211,
|
||||
"response_id": "chatcmpl-6a6a7d3f8a024a47783f03bf",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363776
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2102,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 486,
|
||||
"latency_s": 9.166883945465088,
|
||||
"response_id": "chatcmpl-6a6a7d43503e5013c8fe6ef8",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363779
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2262,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 499,
|
||||
"latency_s": 4.3432776927948,
|
||||
"response_id": "chatcmpl-6a6a7d4c687ea3db1a5a4d6c",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363789
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "both",
|
||||
"name": "B 优化(KV缓存+压缩)",
|
||||
"total_cost": 0.009057608026520501,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0042445922080159995,
|
||||
"cached_input_cost": 0.0008403612730964999,
|
||||
"output_cost": 0.003972654545408001,
|
||||
"uncached_input_tokens": 7180,
|
||||
"cached_input_tokens": 8123,
|
||||
"output_tokens": 1280,
|
||||
"tool_ctx_tokens": 6036
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.0011322010033150626,
|
||||
"p50": 0.0011570356364336,
|
||||
"p95": 0.0014060359481248,
|
||||
"p99": 0.0014060359481248,
|
||||
"max": 0.0014060359481248
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 955,
|
||||
"cached_tokens": 955,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 3.2073097229003906,
|
||||
"response_id": "chatcmpl-6a6a7d7658a6e8702ecebaee",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363830
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1652,
|
||||
"cached_tokens": 512,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 7.249981880187988,
|
||||
"response_id": "chatcmpl-6a6a7d792d20c6aa1053113f",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363833
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2038,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 4.833154916763306,
|
||||
"response_id": "chatcmpl-6a6a7d80f9aa90a3ebfd7fe5",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363841
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2172,
|
||||
"cached_tokens": 768,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1231,
|
||||
"latency_s": 5.391065835952759,
|
||||
"response_id": "chatcmpl-6a6a7d852d20c6aa10531154",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363846
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1962,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 780,
|
||||
"latency_s": 5.175268888473511,
|
||||
"response_id": "chatcmpl-6a6a7d8b2d20c6aa10531162",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363851
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2063,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 677,
|
||||
"latency_s": 5.356127977371216,
|
||||
"response_id": "chatcmpl-6a6a7d90a183ecb32232c19d",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363856
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2148,
|
||||
"cached_tokens": 1280,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 486,
|
||||
"latency_s": 7.17538595199585,
|
||||
"response_id": "chatcmpl-6a6a7d953905097c262cd43c",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363862
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2313,
|
||||
"cached_tokens": 1536,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 499,
|
||||
"latency_s": 5.300028085708618,
|
||||
"response_id": "chatcmpl-6a6a7d9d56e2191f9ae786d6",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363869
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,554 @@
|
||||
{
|
||||
"model": "kimi-k2.5",
|
||||
"pricing": {
|
||||
"input": 0.5911688312,
|
||||
"cached": 0.1034545455,
|
||||
"output": 3.1036363636
|
||||
},
|
||||
"scenarios": [
|
||||
{
|
||||
"key": "naive",
|
||||
"name": "A 朴素(无缓存/无压缩)",
|
||||
"total_cost": 0.01574031350707,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0118080062343888,
|
||||
"cached_input_cost": 0.0,
|
||||
"output_cost": 0.0039323072726812,
|
||||
"uncached_input_tokens": 19974,
|
||||
"cached_input_tokens": 0,
|
||||
"output_tokens": 1267,
|
||||
"tool_ctx_tokens": 10749
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.00196753918838375,
|
||||
"p50": 0.0019544041559152,
|
||||
"p95": 0.0026135574027031996,
|
||||
"p99": 0.0026135574027031996,
|
||||
"max": 0.0026135574027031996
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1015,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 5.299084663391113,
|
||||
"response_id": "chatcmpl-6a6a7cb80695ae5455eab84a",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363640
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1706,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 147,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 5.079176902770996,
|
||||
"response_id": "chatcmpl-6a6a7cbd80925af8edb8bb5e",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363646
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2081,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 3.0797362327575684,
|
||||
"response_id": "chatcmpl-6a6a7cc24511d264b10f37dd",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363651
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2466,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1482,
|
||||
"latency_s": 3.4901974201202393,
|
||||
"response_id": "chatcmpl-6a6a7cc5edbcdbb3613f3353",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363654
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2753,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1585,
|
||||
"latency_s": 6.93122410774231,
|
||||
"response_id": "chatcmpl-6a6a7cc97f6a7380b55ebedb",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363658
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3048,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1693,
|
||||
"latency_s": 5.43744421005249,
|
||||
"response_id": "chatcmpl-6a6a7cd0d7374244555b9001",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363665
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3324,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1779,
|
||||
"latency_s": 5.579896926879883,
|
||||
"response_id": "chatcmpl-6a6a7cd56f58f5f62fa2981a",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363670
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3581,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1847,
|
||||
"latency_s": 5.334557056427002,
|
||||
"response_id": "chatcmpl-6a6a7cdb2e6a18d37452de21",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363676
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "kv",
|
||||
"name": "KV 仅缓存(稳定前缀/不压缩)",
|
||||
"total_cost": 0.0082537957670069,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0027956374027448,
|
||||
"cached_input_cost": 0.0015289547279445,
|
||||
"output_cost": 0.0039292036363176,
|
||||
"uncached_input_tokens": 4729,
|
||||
"cached_input_tokens": 14779,
|
||||
"output_tokens": 1266,
|
||||
"tool_ctx_tokens": 10749
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.0010317244708758625,
|
||||
"p50": 0.001053935792344,
|
||||
"p95": 0.0011930969351368,
|
||||
"p99": 0.0011930969351368,
|
||||
"max": 0.0011930969351368
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 955,
|
||||
"cached_tokens": 955,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 2.981578826904297,
|
||||
"response_id": "chatcmpl-6a6a7d043905097c262cd2d8",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363716
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1652,
|
||||
"cached_tokens": 512,
|
||||
"completion_tokens": 146,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 8.04120397567749,
|
||||
"response_id": "chatcmpl-6a6a7d07d5eb4229617017c7",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363719
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2023,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 6.327085256576538,
|
||||
"response_id": "chatcmpl-6a6a7d0f3905097c262cd2f5",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363727
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2408,
|
||||
"cached_tokens": 1792,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1482,
|
||||
"latency_s": 4.883957862854004,
|
||||
"response_id": "chatcmpl-6a6a7d15bb40cba1f65cc486",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363733
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2696,
|
||||
"cached_tokens": 2048,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1585,
|
||||
"latency_s": 5.0474817752838135,
|
||||
"response_id": "chatcmpl-6a6a7d1adc87cefde7ebcca2",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363738
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2986,
|
||||
"cached_tokens": 2560,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1693,
|
||||
"latency_s": 3.6142687797546387,
|
||||
"response_id": "chatcmpl-6a6a7d1f3905097c262cd332",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363743
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3266,
|
||||
"cached_tokens": 2816,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1779,
|
||||
"latency_s": 3.981088161468506,
|
||||
"response_id": "chatcmpl-6a6a7d233905097c262cd33e",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363747
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 3522,
|
||||
"cached_tokens": 3072,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1847,
|
||||
"latency_s": 5.233341217041016,
|
||||
"response_id": "chatcmpl-6a6a7d27d5eb42296170182d",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363751
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "compress",
|
||||
"name": "仅压缩(前缀不稳定/摘要)",
|
||||
"total_cost": 0.0125982511692596,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0089390638965752,
|
||||
"cached_input_cost": 0.0,
|
||||
"output_cost": 0.0036591872726844,
|
||||
"uncached_input_tokens": 15121,
|
||||
"cached_input_tokens": 0,
|
||||
"output_tokens": 1179,
|
||||
"tool_ctx_tokens": 6036
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.00157478139615745,
|
||||
"p50": 0.0016801018182384,
|
||||
"p95": 0.0018338057143504,
|
||||
"p99": 0.0018338057143504,
|
||||
"max": 0.0018338057143504
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1010,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 121,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 3.843111276626587,
|
||||
"response_id": "chatcmpl-6a6a7d2c96a5dde81c3844dd",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363756
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1671,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 110,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 3.103135108947754,
|
||||
"response_id": "chatcmpl-6a6a7d3006fe5c9e72518409",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363760
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2002,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 5.465490102767944,
|
||||
"response_id": "chatcmpl-6a6a7d3384ead76d6951b7bb",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363763
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2136,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 149,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1231,
|
||||
"latency_s": 3.5718801021575928,
|
||||
"response_id": "chatcmpl-6a6a7d3880925af8edb8bcdd",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363769
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1916,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 780,
|
||||
"latency_s": 3.5103132724761963,
|
||||
"response_id": "chatcmpl-6a6a7d3cfa52c1b646ff684d",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363772
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2022,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 159,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 677,
|
||||
"latency_s": 3.597494125366211,
|
||||
"response_id": "chatcmpl-6a6a7d3f8a024a47783f03bf",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363776
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2102,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 486,
|
||||
"latency_s": 9.166883945465088,
|
||||
"response_id": "chatcmpl-6a6a7d43503e5013c8fe6ef8",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363779
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2262,
|
||||
"cached_tokens": 0,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 499,
|
||||
"latency_s": 4.3432776927948,
|
||||
"response_id": "chatcmpl-6a6a7d4c687ea3db1a5a4d6c",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363789
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "both",
|
||||
"name": "B 优化(KV缓存+压缩)",
|
||||
"total_cost": 0.009057608026520501,
|
||||
"component_costs": {
|
||||
"uncached_input_cost": 0.0042445922080159995,
|
||||
"cached_input_cost": 0.0008403612730964999,
|
||||
"output_cost": 0.003972654545408001,
|
||||
"uncached_input_tokens": 7180,
|
||||
"cached_input_tokens": 8123,
|
||||
"output_tokens": 1280,
|
||||
"tool_ctx_tokens": 6036
|
||||
},
|
||||
"cost_distribution": {
|
||||
"n": 8,
|
||||
"mean": 0.0011322010033150626,
|
||||
"p50": 0.0011570356364336,
|
||||
"p95": 0.0014060359481248,
|
||||
"p99": 0.0014060359481248,
|
||||
"max": 0.0014060359481248
|
||||
},
|
||||
"spans": [
|
||||
{
|
||||
"step": "turn-1",
|
||||
"tool": "query_order",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 955,
|
||||
"cached_tokens": 955,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 300,
|
||||
"latency_s": 3.2073097229003906,
|
||||
"response_id": "chatcmpl-6a6a7d7658a6e8702ecebaee",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363830
|
||||
},
|
||||
{
|
||||
"step": "turn-2",
|
||||
"tool": "query_logistics",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1652,
|
||||
"cached_tokens": 512,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 899,
|
||||
"latency_s": 7.249981880187988,
|
||||
"response_id": "chatcmpl-6a6a7d792d20c6aa1053113f",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363833
|
||||
},
|
||||
{
|
||||
"step": "turn-3",
|
||||
"tool": "check_refund_policy",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2038,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1164,
|
||||
"latency_s": 4.833154916763306,
|
||||
"response_id": "chatcmpl-6a6a7d80f9aa90a3ebfd7fe5",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363841
|
||||
},
|
||||
{
|
||||
"step": "turn-4",
|
||||
"tool": "query_knowledge_base",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2172,
|
||||
"cached_tokens": 768,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 1231,
|
||||
"latency_s": 5.391065835952759,
|
||||
"response_id": "chatcmpl-6a6a7d852d20c6aa10531154",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363846
|
||||
},
|
||||
{
|
||||
"step": "turn-5",
|
||||
"tool": "query_user_history",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 1962,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 780,
|
||||
"latency_s": 5.175268888473511,
|
||||
"response_id": "chatcmpl-6a6a7d8b2d20c6aa10531162",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363851
|
||||
},
|
||||
{
|
||||
"step": "turn-6",
|
||||
"tool": "issue_refund",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2063,
|
||||
"cached_tokens": 1024,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 677,
|
||||
"latency_s": 5.356127977371216,
|
||||
"response_id": "chatcmpl-6a6a7d90a183ecb32232c19d",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363856
|
||||
},
|
||||
{
|
||||
"step": "turn-7",
|
||||
"tool": "send_notification",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2148,
|
||||
"cached_tokens": 1280,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 486,
|
||||
"latency_s": 7.17538595199585,
|
||||
"response_id": "chatcmpl-6a6a7d953905097c262cd43c",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363862
|
||||
},
|
||||
{
|
||||
"step": "turn-8",
|
||||
"tool": "close_ticket",
|
||||
"kind": "llm",
|
||||
"prompt_tokens": 2313,
|
||||
"cached_tokens": 1536,
|
||||
"completion_tokens": 160,
|
||||
"reasoning_tokens": 1,
|
||||
"tool_ctx_tokens": 499,
|
||||
"latency_s": 5.300028085708618,
|
||||
"response_id": "chatcmpl-6a6a7d9d56e2191f9ae786d6",
|
||||
"response_model": "kimi-k2.5",
|
||||
"response_created": 1785363869
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user