SShortSingh.
Back to feed

AICostTracker v0.1.2 adds one-line auto-logging for OpenAI and Anthropic API calls

0
·1 views

A new open-source tool called AICostTracker now offers a track() function that automatically logs every OpenAI or Anthropic API call without requiring changes to existing code. Developers simply wrap their AI client with track() and assign a project tag, after which token usage and costs are recorded silently in the background. The wrapper intercepts API responses to extract usage data, adds zero latency, and suppresses any logging errors so that API calls are never disrupted. Running aicost summary then displays a breakdown of total spend, token counts, and costs grouped by project and model. The tool is available as an npm package under @ozperium/aicost-tracker, with source code published on GitHub.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Researcher Flags Potential Emotional Safety Gap in GPT-5.6 Sol Reasoning Model

A developer has published an informal analysis suggesting that GPT-5.6 Sol, OpenAI's advanced reasoning model, may carry a conversational safety vulnerability rooted in its strong orientation toward logical precision. The author observed recurring patterns in which the model responded to emotionally sensitive disclosures — such as fear of illness or grief — with technically accurate but psychologically cold replies. The hypothesis is that post-training optimization for task performance and epistemic correctness may have come at the expense of relational sensitivity. The author explicitly acknowledges the findings are not from a controlled study, were not consistently reproducible, and do not constitute a formal safety assessment. The article calls for systematic, independently reproducible investigation into whether logic-first alignment poses risks for vulnerable users in distress.

0
ProgrammingDEV Community ·

BlackBull framework runs HTTP/SSE and MQTT broker in one Python process on edge hardware

Developer Joren Vranckaert has built BlackBull, a pure-Python ASGI framework that consolidates HTTP/1.1, HTTP/2, WebSocket, gRPC, and an MQTT 5 broker into a single process. The project targets edge devices such as Raspberry Pi and Jetson boards, where running multiple daemons — a web server, reverse proxy, and separate MQTT broker — adds provisioning complexity and cross-compilation overhead. BlackBull allows browser clients to receive token-by-token streamed responses via Server-Sent Events over HTTP/2, while IoT sensors and devices communicate concurrently over MQTT on the same box. To prevent blocking the async event loop during CPU-bound model inference, the framework offloads computation to a worker thread and drains tokens through an asyncio queue. The framework is designed to be dependency-free for basic demos, with support for real model backends such as llama-cpp and ONNX through its threading pattern.

0
ProgrammingDEV Community ·

Qarinah tool cuts AI coding agent context tokens by 98% using typed memory packs

A developer built Qarinah, an open-source local memory compiler for AI coding agents like Codex and Claude Code, to address the high cost and inefficiency of replaying entire codebases in long sessions. Instead of sending full project history or relying on generated summaries, Qarinah organizes project knowledge into typed events — decisions, tool outcomes, approvals — linked by relations such as supersedes and supports. When a new task begins, the tool retrieves a small, citation-linked context pack relevant only to that task, keeping source records and context packs separate. In a test across six software tasks, this approach reduced estimated input-context tokens from roughly 442,000 to about 5,700 — a compression ratio of nearly 78:1 — while maintaining retrieval accuracy. Qarinah is available as an npm package under the Apache-2.0 license and ships with plugins for both Codex and Claude Code.

0
ProgrammingDEV Community ·

How AI Evolved From ChatGPT to Autonomous Agents: A Layer-by-Layer Explainer

A student at an English school in Baguio, the Philippines, delivered a talk to classmates explaining how AI technology has progressed from ChatGPT's launch in November 2022 to the era of autonomous AI agents by 2026. The talk outlined key milestones, including the mainstream adoption of RAG for document-grounded answers, OpenAI's introduction of function calling, and Anthropic's Model Context Protocol standardizing tool access. A central theme was that large language models predict text rather than look up facts, making hallucination an inherent structural limitation rather than a fixable bug. Each subsequent development — reasoning models, agents, and reusable agent skills — was framed as a layer built to compensate for the constraints of the layer before it. The explainer was aimed at everyday ChatGPT users who have encountered terms like LLM, RAG, and MCP without a clear understanding of what they actually do.