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

LLM should default to logging to SQLite #68

Closed
2 of 3 tasks
simonw opened this issue Jul 1, 2023 · 6 comments
Closed
2 of 3 tasks

LLM should default to logging to SQLite #68

simonw opened this issue Jul 1, 2023 · 6 comments
Labels
enhancement New feature or request
Milestone

Comments

@simonw
Copy link
Owner

simonw commented Jul 1, 2023

Currently you have to remember to run llm init-db first - but I think running llm logs may create that database as a side effect?

It should log by default, and provide an option for turning logging off using the same mechanism as:

TODO

  • Log by default
  • Setting mechanism for turning off log-by-default
  • --log option for turning on logging for a specific prompt
@simonw simonw added the enhancement New feature or request label Jul 1, 2023
@simonw
Copy link
Owner Author

simonw commented Jul 1, 2023

There's already a --no-log option, I can add a --log mechanism for explicitly logging even if the setting is turned off.

@simonw simonw added this to the 0.5 milestone Jul 10, 2023
@simonw
Copy link
Owner Author

simonw commented Jul 11, 2023

Relevant code:

llm/llm/cli.py

Lines 249 to 254 in 1bdb2e7

log_path = logs_db_path()
if not log_path.exists():
return
db = sqlite_utils.Database(log_path)
migrate(db)
response.log_to_db(db)

@simonw
Copy link
Owner Author

simonw commented Jul 12, 2023

Need to update the documentation around this too.

@simonw
Copy link
Owner Author

simonw commented Jul 12, 2023

Setting the default model looks like this:

llm models default gpt-4

For disabling and enabling logs I'm going to go with:

llm logs off

llm logs on

@simonw
Copy link
Owner Author

simonw commented Jul 12, 2023

I feel like there should be a way to tell the current status of logging too. Maybe:

llm logs status

Which could show not just the on/off state but also the size of the DB and number of records in it.

@simonw
Copy link
Owner Author

simonw commented Jul 12, 2023

I just need the --log option now.

@simonw simonw closed this as completed in fa67b3f Jul 12, 2023
simonw added a commit that referenced this issue Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant