Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log LLM costs and info #108

Merged
merged 6 commits into from
Nov 22, 2024
Merged

Log LLM costs and info #108

merged 6 commits into from
Nov 22, 2024

Conversation

rizar
Copy link
Collaborator

@rizar rizar commented Nov 21, 2024

  • save costs and llm_info in SQLite
  • show aggregates in GAIA tape browser (we should move this to the main tape browser)
  • add a script to patch old SQLite databases to be loadable

3 tests fail in gaia_planner, same tests fail in this branch

looks like this:
image

@rizar rizar requested a review from ollmer November 22, 2024 13:59
tapeagents/llms.py Outdated Show resolved Hide resolved
c.execute(f"PRAGMA table_info{_llm_calls}")
columns = [row[1] for row in c.fetchall()]
if "llm_info" not in columns:
c.execute(f"ALTER TABLE {_llm_calls} ADD COLUMN llm_info TEXT DEFAULT '{{}}'")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make the column name configurable from the args of the script. This way we can reuse it next time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it will work, cause you need default values. I would not ever-generalize this tool, it's a good starting point, but it is easier to edit than to make fully reusable.

Copy link
Collaborator

@ollmer ollmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rizar rizar merged commit 4e89b87 into gaia_planner Nov 22, 2024
@rizar rizar deleted the llm_costs_and_info branch January 14, 2025 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants