MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / compare_llm_models

Function compare_llm_models

experiments/token_cost/token_usage_tracker.py:338–358  ·  view source on GitHub ↗

对比不同 LLM 模型的 token 消耗

(
    date: str,
    papers: List[Dict],
    user_profiles: List[Dict],
    models: List[str] = None,
)

Source from the content-addressed store, hash-verified

336
337
338def compare_llm_models(
339 date: str,
340 papers: List[Dict],
341 user_profiles: List[Dict],
342 models: List[str] = None,
343) -> List[Dict[str, Any]]:
344 """对比不同 LLM 模型的 token 消耗"""
345 if models is None:
346 models = ["qwen3.5-plus", "qwen-plus", "qwen-max"]
347
348 results = []
349 for model in models:
350 print(f"Benchmarking {model}...")
351 result = benchmark_one_day(date, model, papers, user_profiles)
352 results.append(result)
353
354 # 清空日志以便下次测试
355 if TOKEN_LOG_PATH.exists():
356 TOKEN_LOG_PATH.unlink()
357
358 return results
359
360
361def main():

Callers 1

mainFunction · 0.85

Calls 1

benchmark_one_dayFunction · 0.85

Tested by

no test coverage detected