|
2 | 2 |
|
3 | 3 | # 🛡️ AgentGuard |
4 | 4 |
|
5 | | -**Stop AI agents from burning your money** |
| 5 | +**Real-time cost monitoring for AI agents** |
6 | 6 |
|
7 | 7 | [](https://npmjs.com/package/agent-guard) |
8 | 8 | [](https://opensource.org/licenses/MIT) |
9 | 9 | [](https://nodejs.org/) |
10 | | -[](https://github.com/dipampaul17/AgentGuard) |
11 | 10 |
|
12 | | -*The emergency brake for runaway AI costs* |
| 11 | +*Two lines of code. Automatic cost tracking. No surprises.* |
13 | 12 |
|
14 | 13 | </div> |
15 | 14 |
|
16 | 15 | --- |
17 | 16 |
|
18 | | -## 🚨 The Problem |
| 17 | +## The Problem |
19 | 18 |
|
20 | | -Every AI developer has been there: |
21 | | -- 🔥 **Infinite loop** burns through $500 overnight |
22 | | -- 📈 **Development costs** exceed the solution |
23 | | -- 💳 **OpenAI bills** that make you cry |
24 | | -- 😰 **Deploy anxiety** because agents can go rogue |
| 19 | +Building AI agents? Your biggest fear is probably this: |
| 20 | +- **Runaway costs** from infinite loops or bugs |
| 21 | +- **Development bills** that spiral out of control |
| 22 | +- **No visibility** into what your agent is actually spending |
| 23 | +- **Production anxiety** about deploying autonomous systems |
25 | 24 |
|
26 | | -## ✨ The Solution |
| 25 | +## The Solution |
27 | 26 |
|
28 | | -AgentGuard is a **production-ready kill switch** that monitors your AI agent costs in real-time and automatically terminates processes when they exceed your budget. **Battle-tested** with comprehensive test coverage and CI/CD pipelines. |
| 27 | +AgentGuard automatically tracks your AI API costs in real-time and stops execution when you hit your budget. No code changes needed - just add two lines and keep building. |
29 | 28 |
|
30 | 29 | ```javascript |
31 | | -// Before: Vulnerable to runaway costs |
32 | | -const response = await openai.chat.completions.create({...}); |
33 | | - |
34 | | -// After: Protected by AgentGuard |
| 30 | +// Add these two lines to any AI agent: |
35 | 31 | const agentGuard = require('agent-guard'); |
36 | 32 | await agentGuard.init({ limit: 50 }); |
| 33 | + |
| 34 | +// Your existing code works unchanged: |
37 | 35 | const response = await openai.chat.completions.create({...}); |
38 | | -// 🛡️ AgentGuard now monitors every API call automatically |
39 | | -``` |
| 36 | +console.log(response); // ← AgentGuard automatically tracks this |
40 | 37 |
|
41 | | -## 🎯 Key Features |
| 38 | +// Real-time cost display: |
| 39 | +// 💸 $12.34 / $50 24.7% |
| 40 | +``` |
42 | 41 |
|
43 | | -- **🔥 Minimal Dependencies** - Lightweight ~18KB core file with optional tokenizers |
44 | | -- **⚡ Zero Configuration** - Works out of the box |
45 | | -- **🎨 Beautiful Terminal UI** - Real-time cost display with warnings |
46 | | -- **🤖 Multi-Model Support** - OpenAI, Anthropic, Claude, GPT-4o |
47 | | -- **🌐 Multi-Platform** - Node.js and Browser with TypeScript support |
48 | | -- **🚨 Instant Kill Switch** - Terminates at your cost limit |
49 | | -- **📊 Accurate Tracking** - Real token counting and pricing |
50 | | -- **✅ Production Ready** - Comprehensive test suite, CI/CD, stable release |
| 42 | +## What It Does |
51 | 43 |
|
52 | | -## 🚀 Quick Start |
| 44 | +- **Automatic tracking** - Watches console.log, fetch, and axios automatically |
| 45 | +- **Real-time display** - Shows current costs as your agent runs |
| 46 | +- **Multi-model support** - OpenAI (GPT-4, GPT-3.5), Anthropic (Claude), embeddings |
| 47 | +- **Flexible limits** - Set budget in dollars, auto-kill or just warn |
| 48 | +- **Zero code changes** - Works with your existing OpenAI/Anthropic code |
| 49 | +- **TypeScript support** - Full type definitions included |
| 50 | +- **18KB lightweight** - No bloat, minimal dependencies |
53 | 51 |
|
54 | | -Ready to protect your AI budget in 30 seconds? |
| 52 | +## Quick Start |
55 | 53 |
|
56 | 54 | ### Installation |
57 | 55 |
|
@@ -207,31 +205,31 @@ node verify-installation.js |
207 | 205 |
|
208 | 206 | MIT - Use anywhere, even commercial projects. |
209 | 207 |
|
210 | | -## 🆘 Support |
| 208 | +## Support |
| 209 | + |
| 210 | +Having issues? Found a bug? |
211 | 211 |
|
212 | | -- 📧 **Issues**: [GitHub Issues](https://github.com/dipampaul17/AgentGuard/issues) |
213 | | -- 💬 **Questions**: [GitHub Discussions](https://github.com/dipampaul17/AgentGuard/discussions) |
214 | | -- 🐛 **Bug Reports**: [Bug Report Template](https://github.com/dipampaul17/AgentGuard/issues/new) |
| 212 | +- [GitHub Issues](https://github.com/dipampaul17/AgentGuard/issues) for bugs |
| 213 | +- [GitHub Discussions](https://github.com/dipampaul17/AgentGuard/discussions) for questions |
215 | 214 |
|
216 | | -## 📋 What's New in v1.1.0 |
| 215 | +## What's Included |
217 | 216 |
|
218 | | -- ✅ **Fixed CI/CD Issues** - Resolved all test timing issues for reliable deployments |
219 | | -- 🔧 **Enhanced Test Suite** - Comprehensive testing with 200ms wait times for CI environments |
220 | | -- 🚀 **Production Stability** - Battle-tested codebase ready for enterprise use |
221 | | -- 📦 **NPM Ready** - Clean package with only essential files (31.8kB total) |
222 | | -- 🛡️ **Zero Gaps** - Every claimed feature is fully implemented and tested |
| 217 | +- **Core monitoring** - Tracks OpenAI, Anthropic, and embedding costs |
| 218 | +- **Working examples** - Real LangChain integration, runaway loop demo |
| 219 | +- **TypeScript support** - Full type definitions |
| 220 | +- **Browser build** - Use in web applications |
| 221 | +- **Verification script** - Test installation instantly |
223 | 222 |
|
224 | 223 | --- |
225 | 224 |
|
226 | 225 | <div align="center"> |
227 | 226 |
|
228 | | -**🛡️ AgentGuard v1.1.0 - Stop losing money. Start shipping safely.** |
| 227 | +**AgentGuard - Real-time cost monitoring for AI agents** |
229 | 228 |
|
230 | | -**Production-ready | CI/CD tested | Zero gaps** |
| 229 | +*Two lines of code. Automatic tracking. No surprises.* |
231 | 230 |
|
232 | 231 | [⭐ Star on GitHub](https://github.com/dipampaul17/AgentGuard) • |
233 | | -[📦 NPM Package](https://npmjs.com/package/agent-guard) • |
234 | | -[📖 Quick Start](QUICKSTART.md) |
| 232 | +[📦 NPM Package](https://npmjs.com/package/agent-guard) |
235 | 233 |
|
236 | 234 | *Trusted by developers building the future of AI* |
237 | 235 |
|
|
0 commit comments