agentic-flow 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -12
- package/dist/agents/claudeAgent.js +96 -67
- package/dist/cli/claude-code-wrapper.js +23 -1
- package/dist/cli-proxy.js +71 -5
- package/dist/mcp/standalone-stdio.js +251 -2
- package/dist/proxy/anthropic-to-requesty.js +707 -0
- package/dist/utils/cli.js +6 -0
- package/dist/utils/modelCapabilities.js +22 -0
- package/docs/plans/agent-booster/00-INDEX.md +230 -0
- package/docs/plans/agent-booster/00-OVERVIEW.md +454 -0
- package/docs/plans/agent-booster/01-ARCHITECTURE.md +699 -0
- package/docs/plans/agent-booster/02-INTEGRATION.md +771 -0
- package/docs/plans/agent-booster/03-BENCHMARKS.md +616 -0
- package/docs/plans/agent-booster/04-NPM-SDK.md +673 -0
- package/docs/plans/agent-booster/GITHUB-ISSUE.md +523 -0
- package/docs/plans/agent-booster/README.md +576 -0
- package/docs/plans/requesty/00-overview.md +176 -0
- package/docs/plans/requesty/01-api-research.md +573 -0
- package/docs/plans/requesty/02-architecture.md +1076 -0
- package/docs/plans/requesty/03-implementation-phases.md +1129 -0
- package/docs/plans/requesty/04-testing-strategy.md +905 -0
- package/docs/plans/requesty/05-migration-guide.md +576 -0
- package/docs/plans/requesty/README.md +290 -0
- package/package.json +1 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Requesty.ai Integration - Overview
|
|
2
|
+
|
|
3
|
+
## Executive Summary
|
|
4
|
+
|
|
5
|
+
This document outlines the plan to integrate Requesty.ai as a new provider in the agentic-flow project, following the same architectural pattern as the existing OpenRouter integration.
|
|
6
|
+
|
|
7
|
+
### What is Requesty.ai?
|
|
8
|
+
|
|
9
|
+
Requesty.ai is a unified AI gateway that provides:
|
|
10
|
+
- **300+ AI Models** - Access to models from OpenAI, Anthropic, Google, and other providers
|
|
11
|
+
- **OpenAI-Compatible API** - Drop-in replacement for OpenAI SDK with `base_url` override
|
|
12
|
+
- **Cost Optimization** - 80% cost savings through intelligent routing and caching
|
|
13
|
+
- **Built-in Analytics** - Real-time usage tracking and performance monitoring
|
|
14
|
+
- **Enterprise Features** - Zero downtime guarantee, automatic failover, load balancing
|
|
15
|
+
|
|
16
|
+
### Integration Goals
|
|
17
|
+
|
|
18
|
+
1. **Provider Parity** - Requesty should work alongside Anthropic, OpenRouter, Gemini, and ONNX
|
|
19
|
+
2. **Minimal Code Changes** - Leverage existing proxy pattern from OpenRouter
|
|
20
|
+
3. **Model Flexibility** - Support 300+ models through Requesty's router
|
|
21
|
+
4. **Tool Support** - Maintain full MCP tool calling compatibility
|
|
22
|
+
5. **Cost Optimization** - Enable users to access cheaper models with same quality
|
|
23
|
+
|
|
24
|
+
### Key Differentiators from OpenRouter
|
|
25
|
+
|
|
26
|
+
| Feature | OpenRouter | Requesty.ai |
|
|
27
|
+
|---------|-----------|-------------|
|
|
28
|
+
| Model Count | 100+ | 300+ |
|
|
29
|
+
| API Format | OpenAI `/chat/completions` | OpenAI `/chat/completions` |
|
|
30
|
+
| Base URL | `https://openrouter.ai/api/v1` | `https://router.requesty.ai/v1` |
|
|
31
|
+
| Authentication | `Authorization: Bearer sk-or-...` | `Authorization: Bearer requesty-...` |
|
|
32
|
+
| Cost Savings | ~90% vs Claude | ~80% vs Claude |
|
|
33
|
+
| Tool Calling | Native OpenAI format | Native OpenAI format |
|
|
34
|
+
| Unique Features | Leaderboard tracking | Auto-routing, caching, analytics |
|
|
35
|
+
|
|
36
|
+
### Strategic Benefits
|
|
37
|
+
|
|
38
|
+
1. **Provider Diversity** - Reduces dependency on single gateway
|
|
39
|
+
2. **Model Access** - 300+ models vs OpenRouter's 100+
|
|
40
|
+
3. **Cost Flexibility** - Users can choose based on price/performance
|
|
41
|
+
4. **Redundancy** - Fallback option if OpenRouter has issues
|
|
42
|
+
5. **Enterprise Features** - Built-in analytics and monitoring
|
|
43
|
+
|
|
44
|
+
## Integration Approach
|
|
45
|
+
|
|
46
|
+
### Architecture Pattern
|
|
47
|
+
|
|
48
|
+
Requesty will follow the **same proxy architecture** as OpenRouter:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
User Request (Anthropic Format)
|
|
52
|
+
↓
|
|
53
|
+
Agentic Flow CLI
|
|
54
|
+
↓
|
|
55
|
+
Provider Detection (--provider requesty)
|
|
56
|
+
↓
|
|
57
|
+
Anthropic-to-Requesty Proxy Server
|
|
58
|
+
↓
|
|
59
|
+
Format Conversion (Anthropic → OpenAI)
|
|
60
|
+
↓
|
|
61
|
+
Requesty Router (https://router.requesty.ai/v1)
|
|
62
|
+
↓
|
|
63
|
+
Model Execution (300+ models)
|
|
64
|
+
↓
|
|
65
|
+
Response Conversion (OpenAI → Anthropic)
|
|
66
|
+
↓
|
|
67
|
+
Return to User
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### File Structure
|
|
71
|
+
|
|
72
|
+
New files to create:
|
|
73
|
+
```
|
|
74
|
+
agentic-flow/
|
|
75
|
+
├── src/
|
|
76
|
+
│ └── proxy/
|
|
77
|
+
│ └── anthropic-to-requesty.ts # NEW - Requesty proxy (clone from OpenRouter)
|
|
78
|
+
├── docs/
|
|
79
|
+
│ └── plans/
|
|
80
|
+
│ └── requesty/
|
|
81
|
+
│ ├── 00-overview.md # This file
|
|
82
|
+
│ ├── 01-api-research.md
|
|
83
|
+
│ ├── 02-architecture.md
|
|
84
|
+
│ ├── 03-implementation-phases.md
|
|
85
|
+
│ ├── 04-testing-strategy.md
|
|
86
|
+
│ └── 05-migration-guide.md
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Existing files to modify:
|
|
90
|
+
```
|
|
91
|
+
agentic-flow/
|
|
92
|
+
├── src/
|
|
93
|
+
│ ├── cli-proxy.ts # Add Requesty provider detection
|
|
94
|
+
│ ├── agents/claudeAgent.ts # Add Requesty to provider list
|
|
95
|
+
│ └── utils/
|
|
96
|
+
│ ├── modelCapabilities.ts # Add Requesty model mappings
|
|
97
|
+
│ └── modelOptimizer.ts # Include Requesty models in optimizer
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Success Criteria
|
|
101
|
+
|
|
102
|
+
### Must Have (MVP)
|
|
103
|
+
- [ ] Users can use `--provider requesty` flag
|
|
104
|
+
- [ ] Requesty API key via `REQUESTY_API_KEY` environment variable
|
|
105
|
+
- [ ] Chat completions work with at least 10 tested models
|
|
106
|
+
- [ ] Native tool calling support (MCP tools work)
|
|
107
|
+
- [ ] Streaming responses supported
|
|
108
|
+
- [ ] Error handling and logging
|
|
109
|
+
- [ ] Model override via `--model` flag
|
|
110
|
+
|
|
111
|
+
### Should Have (V1)
|
|
112
|
+
- [ ] Tool emulation for models without native support
|
|
113
|
+
- [ ] Model capability detection for Requesty models
|
|
114
|
+
- [ ] Integration with model optimizer (`--optimize`)
|
|
115
|
+
- [ ] Analytics and usage tracking
|
|
116
|
+
- [ ] Proxy mode for Claude Code/Cursor
|
|
117
|
+
- [ ] Cost estimation and reporting
|
|
118
|
+
|
|
119
|
+
### Nice to Have (Future)
|
|
120
|
+
- [ ] Auto-routing based on cost/performance
|
|
121
|
+
- [ ] Caching integration
|
|
122
|
+
- [ ] Fallback to other providers on error
|
|
123
|
+
- [ ] Model benchmarking and comparison
|
|
124
|
+
|
|
125
|
+
## Timeline Estimate
|
|
126
|
+
|
|
127
|
+
| Phase | Tasks | Estimated Time |
|
|
128
|
+
|-------|-------|----------------|
|
|
129
|
+
| Phase 1 | Research & Planning | 2 hours (DONE) |
|
|
130
|
+
| Phase 2 | Core Proxy Implementation | 4 hours |
|
|
131
|
+
| Phase 3 | CLI Integration | 2 hours |
|
|
132
|
+
| Phase 4 | Testing & Validation | 3 hours |
|
|
133
|
+
| Phase 5 | Documentation | 2 hours |
|
|
134
|
+
| **Total** | | **13 hours** |
|
|
135
|
+
|
|
136
|
+
## Risk Assessment
|
|
137
|
+
|
|
138
|
+
### Technical Risks
|
|
139
|
+
|
|
140
|
+
| Risk | Probability | Impact | Mitigation |
|
|
141
|
+
|------|------------|--------|------------|
|
|
142
|
+
| API format differences from OpenRouter | Medium | Medium | Thorough testing, fallback handling |
|
|
143
|
+
| Model compatibility issues | Low | Medium | Model capability detection system |
|
|
144
|
+
| Tool calling format incompatibility | Low | High | Test with multiple models early |
|
|
145
|
+
| Rate limiting differences | Medium | Low | Document limits, add retry logic |
|
|
146
|
+
|
|
147
|
+
### Business Risks
|
|
148
|
+
|
|
149
|
+
| Risk | Probability | Impact | Mitigation |
|
|
150
|
+
|------|------------|--------|------------|
|
|
151
|
+
| Requesty API changes | Medium | Medium | Version pinning, changelog monitoring |
|
|
152
|
+
| Service availability issues | Low | High | Multi-provider support already in place |
|
|
153
|
+
| Cost model changes | Low | Medium | Document pricing, update optimizer |
|
|
154
|
+
|
|
155
|
+
## Next Steps
|
|
156
|
+
|
|
157
|
+
1. Read `01-api-research.md` for detailed API analysis
|
|
158
|
+
2. Review `02-architecture.md` for technical design
|
|
159
|
+
3. Follow `03-implementation-phases.md` for step-by-step implementation
|
|
160
|
+
4. Use `04-testing-strategy.md` for comprehensive testing
|
|
161
|
+
5. Reference `05-migration-guide.md` for user documentation
|
|
162
|
+
|
|
163
|
+
## Open Questions
|
|
164
|
+
|
|
165
|
+
1. Does Requesty support streaming for all models or only specific ones?
|
|
166
|
+
2. Are there any model-specific quirks in tool calling format?
|
|
167
|
+
3. What are the exact rate limits per tier?
|
|
168
|
+
4. Does Requesty offer a free tier for testing?
|
|
169
|
+
5. How does auto-routing work - can we control it programmatically?
|
|
170
|
+
|
|
171
|
+
## References
|
|
172
|
+
|
|
173
|
+
- Requesty.ai Documentation: https://docs.requesty.ai
|
|
174
|
+
- Requesty.ai Base URL: https://router.requesty.ai/v1
|
|
175
|
+
- OpenRouter Integration (reference): `src/proxy/anthropic-to-openrouter.ts`
|
|
176
|
+
- Gemini Integration (reference): `src/proxy/anthropic-to-gemini.ts`
|