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

Callers 1

mainFunction · 0.85

Calls 1

benchmark_one_dayFunction · 0.85

Tested by

no test coverage detected