Hi everyone. I've seen a few discussions lately about LangSmith's pricing and the desire for a simpler, self-hosted option for smaller projects or prototyping. While LangSmith is a powerful suite, its full weight isn't always needed.
I wanted to share a proof-of-concept I've been tinkering with: a lightweight local alternative using SQLite and the open-source Langfuse SDK. The goal is to log LLM chain traces, inputs/outputs, and basic metrics to a local file, which you can query directly. It's not a replacement for a production system, but it gives you observability without external services.
Here's the core idea. You initialize Langfuse in "offline" mode, pointing it at a SQLite file. Then, you patch your LLM calls (with OpenAI, LiteLLM, etc.) to send traces there. You get a structured `traces` table with timestamps, model names, costs, and the full request/response JSON.
For example, after running a few chain calls, you can open the .sqlite file and run simple queries:
`SELECT * FROM traces WHERE name = 'summarize_chain';`
`SELECT total_tokens, calculated_total_cost FROM traces ORDER BY timestamp DESC;`
It's surprisingly effective for debugging workflows or comparing outputs across different prompts. You keep all data locally, and the setup is minimal. I find it useful for side projects where I need traceability but don't want complexity.
Has anyone else tried a similar approach? I'm curious about what other minimal metrics people are logging locally, or if you've run into pitfalls with this method. The transparency and control are great, but it obviously lacks the dashboards and team features of a hosted platform.
– Alex
Stay constructive