LLM Cost Profiler: Open-source tool tracks API spending to make case for local models

LLM Cost Profiler is an open-source Python tool that tracks every API call your code makes to OpenAI and Anthropic, showing exactly what you're spending, where, and why. The tool exposes which tasks are overpriced relative to their complexity, providing concrete data to make the case for local inference.
Key Features and Findings
The tool stores everything in local SQLite and is MIT licensed. According to the source, it found several specific examples of API call waste:
- A classifier using GPT-4o that outputs one of 5 labels — a task any decent 7B local model handles easily. Cost: ~$89/week on API calls.
- Thousands of duplicate calls to the same prompt — zero caching. Local inference with caching would make this effectively free.
- A summarizer where 34% of calls were retries from format errors. A well-tuned local model with constrained generation eliminates this entire class of waste.
The author notes this tool gives teams concrete ammunition for investing in local inference infrastructure: "Here's the exact dollar amount we'd save by moving X task to a local model."
The tool is available on GitHub at https://github.com/BuildWithAbid/llm-cost-profiler. The author is planning to add support for tracking local model inference costs too (compute time based costing) and asked the community if this would be useful.
This type of cost profiling tool is particularly relevant for developers using AI coding agents, as it provides data-driven insights into where API spending might be inefficient compared to local alternatives.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Developer builds terminal status bar to monitor Claude Code session limits after unexpected cutoff
A developer created a Python terminal statusline that shows Claude Code's session usage live after being cut off mid-refactor without warning. The tool uses existing sessions without requiring an API key.

Tether: An MCP Server for Sharing Context Between AI Models via SQLite
Tether is an open-source tool that collapses JSON data into 28-byte content-addressed handles, allowing multiple AI models to share context through a shared SQLite database. It functions as an MCP server, enabling direct communication between models like Claude and MiniMax without copy-pasting.

Claude Code hooks prevent Chrome tab interference between multiple sessions
A developer created three hooks (session-start, capture-tab-id, enforce-tab-id) that pin each Claude Code session to its own Chrome tab, preventing sessions from accidentally accessing other sessions' tabs during test runs and form fills.

Open Swarm: Open-Source System for Running Thousands of Parallel AI Agents
Open Swarm is an open-source system that spawns thousands of parallel AI agents with full access to 150+ internet tools including email, social media, Google Workspace, web search, code execution, and cron scheduling.