better-ccflare 2.0.18 → 2.0.21
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 +20 -8
- package/dist/better-ccflare +0 -0
- package/package.json +56 -57
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ https://github.com/user-attachments/assets/c859872f-ca5e-4f8b-b6a0-7cc7461fe62a
|
|
|
15
15
|
## Why better-ccflare?
|
|
16
16
|
|
|
17
17
|
- **🚀 Zero Rate Limit Errors** - Automatically distribute requests across multiple accounts
|
|
18
|
-
- **🤖
|
|
18
|
+
- **🤖 Multi-Provider Support** - Setup Claude OAuth, Claude API console, z.ai, Minimax, Anthropic-compatible, and OpenAI-compatible accounts and prioritize in which order they are used
|
|
19
19
|
- **🔗 Custom API Endpoints** - Configure custom endpoints for Anthropic and Zai accounts for enterprise deployments
|
|
20
20
|
- **☁️ OpenAI-Compatible Support** - Use OpenAI-compatible providers like OpenRouter, Together AI, and more with Claude API format
|
|
21
21
|
- **🔄 Smart Auto-Fallback** - Automatically switch back to preferred accounts when their rate limits reset
|
|
@@ -34,7 +34,7 @@ This project builds upon the excellent foundation of [snipeship/ccflare](https:/
|
|
|
34
34
|
- **Enhanced Load Balancing** - Session-based load balancing with intelligent failover
|
|
35
35
|
- **Real-time Analytics Dashboard** - Beautiful web UI for monitoring usage and performance
|
|
36
36
|
- **Smart Rate Limit Management** - Auto-refresh and auto-fallback mechanisms
|
|
37
|
-
- **Multi-Provider Support** - Claude API, z.ai coder, and custom endpoints
|
|
37
|
+
- **Multi-Provider Support** - Claude API, z.ai coder, Minimax, and custom endpoints
|
|
38
38
|
- **Package Distribution** - Available via npm and bun for easy installation
|
|
39
39
|
|
|
40
40
|
**🛠️ Developer Experience:**
|
|
@@ -272,8 +272,8 @@ See [DOCKER.md](DOCKER.md) for detailed Docker documentation.
|
|
|
272
272
|
export ANTHROPIC_BASE_URL=http://localhost:8080
|
|
273
273
|
|
|
274
274
|
# Add multiple accounts with priorities
|
|
275
|
-
better-ccflare --add-account primary --mode
|
|
276
|
-
better-ccflare --add-account secondary --mode
|
|
275
|
+
better-ccflare --add-account primary --mode claude-oauth --priority 0
|
|
276
|
+
better-ccflare --add-account secondary --mode claude-oauth --priority 10
|
|
277
277
|
|
|
278
278
|
# Add OpenAI-compatible provider (like OpenRouter)
|
|
279
279
|
better-ccflare --add-account openrouter --mode openai-compatible --priority 5
|
|
@@ -462,9 +462,10 @@ No `NODE_OPTIONS` needed - Traefik provides trusted certificates automatically!
|
|
|
462
462
|
## Features
|
|
463
463
|
|
|
464
464
|
### 🎯 Intelligent Load Balancing
|
|
465
|
-
- **Session-based** - Maintain conversation context (5hr
|
|
466
|
-
- **Auto-fallback** - Automatically switch back to higher priority accounts when their usage windows reset
|
|
465
|
+
- **Session-based** - Maintain conversation context for Claude OAuth accounts (5hr usage windows), pay-as-you-go for other providers
|
|
466
|
+
- **Auto-fallback** - Automatically switch back to higher priority Claude OAuth accounts when their usage windows reset
|
|
467
467
|
- **Auto-refresh** - Automatically start new usage windows when they reset
|
|
468
|
+
- **Usage Window Alignment** - Sessions automatically align with Claude OAuth usage window resets for optimal resource utilization
|
|
468
469
|
|
|
469
470
|
### 📈 Real-Time Analytics
|
|
470
471
|
- Token usage tracking per request with optimized batch processing
|
|
@@ -488,7 +489,12 @@ No `NODE_OPTIONS` needed - Traefik provides trusted certificates automatically!
|
|
|
488
489
|
- Custom endpoint support for enterprise deployments
|
|
489
490
|
- Enhanced performance with request batching and caching
|
|
490
491
|
|
|
491
|
-
### ☁️
|
|
492
|
+
### ☁️ Multi-Provider Support
|
|
493
|
+
- **Claude OAuth** - Anthropic OAuth accounts with 5-hour usage windows and session tracking (rate limit window based)
|
|
494
|
+
- **Claude Console API** - Anthropic API key accounts with pay-as-you-go model (no session tracking)
|
|
495
|
+
- **z.ai, Minimax** - API key based providers with pay-as-you-go model
|
|
496
|
+
- **Anthropic-Compatible** - Custom Anthropic-compatible providers with pay-as-you-go model
|
|
497
|
+
- **OpenAI-Compatible** - OpenAI-compatible providers (OpenRouter, Together AI, etc.) with Claude API format
|
|
492
498
|
- **Universal API Format** - Use OpenAI-compatible providers (OpenRouter, Together AI, etc.) with Claude API format
|
|
493
499
|
- **Automatic Format Conversion** - Seamless conversion between Anthropic and OpenAI request/response formats
|
|
494
500
|
- **Model Mapping** - Map Claude models (opus, sonnet, haiku) to equivalent OpenAI models
|
|
@@ -536,7 +542,7 @@ Full documentation available in [`docs/`](docs/):
|
|
|
536
542
|
- **Or download pre-compiled binary** - No runtime dependencies required!
|
|
537
543
|
|
|
538
544
|
**For usage:**
|
|
539
|
-
- Claude API accounts (Free, Pro, or Team)
|
|
545
|
+
- Claude API accounts (Free, Pro, or Team), z.ai code plan accounts, or Minimax accounts
|
|
540
546
|
|
|
541
547
|
## Platform Support
|
|
542
548
|
|
|
@@ -570,6 +576,12 @@ Inspired by [snipeship/ccflare](https://github.com/snipeship/ccflare) - thanks f
|
|
|
570
576
|
|
|
571
577
|
We welcome contributions! See [CONTRIBUTING.md](docs/contributing.md) for guidelines.
|
|
572
578
|
|
|
579
|
+
### Code Review Process
|
|
580
|
+
|
|
581
|
+
This repository includes an automated Claude code review system:
|
|
582
|
+
- **Automatic Review**: Runs automatically when a new pull request is opened
|
|
583
|
+
- **Manual Review**: Can be manually triggered by contributors by commenting `/claude-review` on the PR
|
|
584
|
+
|
|
573
585
|
## License
|
|
574
586
|
|
|
575
587
|
MIT - See [LICENSE](LICENSE) for details
|
package/dist/better-ccflare
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,59 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
2
|
+
"name": "better-ccflare",
|
|
3
|
+
"version": "2.0.21",
|
|
4
|
+
"description": "Load balancer proxy for Claude API with intelligent distribution across multiple OAuth accounts to avoid rate limiting",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/tombii/better-ccflare.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/tombii/better-ccflare#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/tombii/better-ccflare/issues"
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"better-ccflare": "dist/better-ccflare"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "bun run src/main.ts",
|
|
20
|
+
"build": "mkdir -p dist && BETTER_CCFLARE_VERSION=$(node -p \"require('./package.json').version\") bun -e \"const fs=require('fs'); if (!fs.existsSync('../../packages/proxy/src/embedded-tiktoken-wasm.ts')) { const wasm=fs.readFileSync('../../node_modules/@dqbd/tiktoken/lite/tiktoken_bg.wasm'); const wasmEncoded=wasm.toString('base64'); fs.writeFileSync('../../packages/proxy/src/embedded-tiktoken-wasm.ts', 'export const EMBEDDED_TIKTOKEN_WASM = \\\"' + wasmEncoded + '\\\";'); }\" && bun build ../../packages/proxy/src/post-processor.worker.ts --outfile dist/post-processor.worker.js --target=bun --minify && bun -e \"const fs=require('fs'); const code=fs.readFileSync('dist/post-processor.worker.js','utf8'); const encoded=Buffer.from(code).toString('base64'); fs.writeFileSync('../../packages/proxy/src/inline-worker.ts', 'export const EMBEDDED_WORKER_CODE = \\\"' + encoded + '\\\";');\" && bun build src/main.ts --compile --outfile dist/better-ccflare --target=bun --minify --define process.env.BETTER_CCFLARE_VERSION='\"'$BETTER_CCFLARE_VERSION'\"' && rm -f dist/post-processor.worker.js",
|
|
21
|
+
"build:multi": "bun run build-multi-arch.ts",
|
|
22
|
+
"build:linux-amd64": "bun run build && bun build src/main.ts --compile --outfile dist/better-ccflare-linux-amd64 --target=bun-linux-amd64 --minify",
|
|
23
|
+
"build:linux-arm64": "bun run build && bun build src/main.ts --compile --outfile dist/better-ccflare-linux-arm64 --target=bun-linux-arm64 --minify",
|
|
24
|
+
"build:macos-x86_64": "bun run build && bun build src/main.ts --compile --outfile dist/better-ccflare-macos-x86_64 --target=bun-darwin-x64 --minify",
|
|
25
|
+
"build:macos-arm64": "bun run build && bun build src/main.ts --compile --outfile dist/better-ccflare-macos-arm64 --target=bun-darwin-arm64 --minify",
|
|
26
|
+
"build:windows-x64": "bun run build && bun build src/main.ts --compile --outfile dist/better-ccflare-windows-x64.exe --target=bun-windows-x64 --minify",
|
|
27
|
+
"prepublishOnly": "cp ../../README.md . && bun run build && jq 'del(.dependencies[\"@better-ccflare/cli-commands\", \"@better-ccflare/config\", \"@better-ccflare/core\", \"@better-ccflare/core-di\", \"@better-ccflare/database\", \"@better-ccflare/logger\", \"@better-ccflare/server\"])' package.json > package.json.tmp && mv package.json.tmp package.json",
|
|
28
|
+
"postpublish": "chmod +x dist/better-ccflare"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^20.0.0"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"dotenv": "^17.2.3"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist/better-ccflare",
|
|
41
|
+
"README.md"
|
|
42
|
+
],
|
|
43
|
+
"keywords": [
|
|
44
|
+
"claude",
|
|
45
|
+
"anthropic",
|
|
46
|
+
"api",
|
|
47
|
+
"proxy",
|
|
48
|
+
"load-balancer",
|
|
49
|
+
"rate-limiting",
|
|
50
|
+
"oauth",
|
|
51
|
+
"cli",
|
|
52
|
+
"analytics",
|
|
53
|
+
"monitoring"
|
|
54
|
+
],
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
}
|
|
59
58
|
}
|