Use condense_json() to make response logging more efficient
Open
Nobody has claimed this yet.
enhancement
logging
- Dominant language
- Python
- Stars
- 12.5k
- Forks
- 998
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 10
Description
Most database log entries currently contain both the prompt and the response twice:
llm logs -c --json
[
{
"id": "01jmddkan06b0568gjk90k134t",
"model": "gpt-4o-mini",
"prompt": "say hi",
"system": null,
"prompt_json": {
"messages": [
{
"role": "user",
"content": "say hi"
}
]
},
"options_json": {},
"response": "Hi there! How can I assist you today?",
"response_json": {
"content": "Hi there! How can I assist you today?",
"finish_reason": "stop",
My new https://github.com/simonw/condense-json library - initially built for #617 - could help here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the llm logs -c --json entry point and inspect how database log records are assembled. Use the referenced condense-json library to avoid duplicating prompt and response data, then verify that the JSON output remains correct and no longer repeats those fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, performance
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100