better-ccflare 3.1.18 → 3.2.0-beta10
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 +2 -75
- package/dist/better-ccflare +0 -0
- package/package.json +56 -56
package/README.md
CHANGED
|
@@ -71,8 +71,6 @@ npm install -g better-ccflare
|
|
|
71
71
|
better-ccflare
|
|
72
72
|
```
|
|
73
73
|
Continue to [Configure Claude SDK](https://github.com/tombii/better-ccflare#configure-claude-sdk).
|
|
74
|
-
|
|
75
|
-
**⚠️ Windows npm Installation Issue**: If you installed via npm on Windows and encounter a path error like `"C:\\Program Files\\nodejs\\\\node_modules\\better-ccflare\\dist\\better-ccflare" is either misspelled or could not be found`, this is a known [npm bug on Windows](https://github.com/npm/cli/issues/969) affecting how npm generates wrapper scripts. See [Windows Troubleshooting](#windows-troubleshooting) for workarounds.
|
|
76
74
|
### Install via bun
|
|
77
75
|
|
|
78
76
|
```bash
|
|
@@ -535,75 +533,6 @@ No `NODE_OPTIONS` needed - Traefik provides trusted certificates automatically!
|
|
|
535
533
|
curl -k https://yourhostname:8080/health
|
|
536
534
|
```
|
|
537
535
|
|
|
538
|
-
## Windows Troubleshooting
|
|
539
|
-
|
|
540
|
-
### Issue: "Command is misspelled or could not be found" after npm install
|
|
541
|
-
|
|
542
|
-
If you installed better-ccflare via npm on Windows and encounter an error like:
|
|
543
|
-
|
|
544
|
-
```
|
|
545
|
-
The command "C:\Program Files\nodejs\\node_modules\better-ccflare\dist\better-ccflare" is either
|
|
546
|
-
misspelled or could not be found.
|
|
547
|
-
```
|
|
548
|
-
|
|
549
|
-
This is a **known npm bug on Windows** (see [npm/cli#969](https://github.com/npm/cli/issues/969) and [nodejs/node#39010](https://github.com/nodejs/node/issues/39010)) affecting how npm generates wrapper scripts with double backslashes in paths.
|
|
550
|
-
|
|
551
|
-
### Workarounds
|
|
552
|
-
|
|
553
|
-
**Option 1: Use `npx` (Recommended)**
|
|
554
|
-
|
|
555
|
-
```powershell
|
|
556
|
-
npx better-ccflare
|
|
557
|
-
```
|
|
558
|
-
|
|
559
|
-
This bypasses the npm wrapper script entirely and runs better-ccflare directly.
|
|
560
|
-
|
|
561
|
-
**Option 2: Use the Pre-compiled Binary**
|
|
562
|
-
|
|
563
|
-
Download the standalone Windows executable from [GitHub Releases](https://github.com/tombii/better-ccflare/releases/latest):
|
|
564
|
-
|
|
565
|
-
```powershell
|
|
566
|
-
# Download better-ccflare-windows-x64.exe and run it directly
|
|
567
|
-
.\better-ccflare-windows-x64.exe
|
|
568
|
-
```
|
|
569
|
-
|
|
570
|
-
**Option 3: Update npm**
|
|
571
|
-
|
|
572
|
-
Sometimes updating to the latest npm version fixes the issue:
|
|
573
|
-
|
|
574
|
-
```powershell
|
|
575
|
-
npm install -g npm@latest
|
|
576
|
-
npm install -g better-ccflare
|
|
577
|
-
```
|
|
578
|
-
|
|
579
|
-
**Option 4: Direct Execution**
|
|
580
|
-
|
|
581
|
-
If you need to use the npm-installed version, you can execute the binary directly:
|
|
582
|
-
|
|
583
|
-
```powershell
|
|
584
|
-
node "%APPDATA%\npm\node_modules\better-ccflare\dist\better-ccflare"
|
|
585
|
-
```
|
|
586
|
-
|
|
587
|
-
**Option 5: Use Bun Package Manager**
|
|
588
|
-
|
|
589
|
-
Bun doesn't have this bug and works correctly on Windows:
|
|
590
|
-
|
|
591
|
-
```powershell
|
|
592
|
-
# Install bun from https://bun.sh
|
|
593
|
-
bun install -g better-ccflare
|
|
594
|
-
better-ccflare
|
|
595
|
-
```
|
|
596
|
-
|
|
597
|
-
### Root Cause
|
|
598
|
-
|
|
599
|
-
This issue is caused by a bug in npm's wrapper script generation on Windows, where it incorrectly constructs paths with double backslashes (`\\nodejs\\\\node_modules`). This is a longstanding npm bug that affects many CLI packages, not just better-ccflare.
|
|
600
|
-
|
|
601
|
-
The issue is being tracked in:
|
|
602
|
-
- [npm/cli#969](https://github.com/npm/cli/issues/969) - Generated .cmd script bugs
|
|
603
|
-
- [nodejs/node#39010](https://github.com/nodejs/node/issues/39010) - Double slashes in Windows paths
|
|
604
|
-
|
|
605
|
-
We recommend using one of the workarounds above until the npm bug is fixed.
|
|
606
|
-
|
|
607
536
|
## Features
|
|
608
537
|
|
|
609
538
|
### 🎯 Intelligent Load Balancing
|
|
@@ -644,7 +573,7 @@ We recommend using one of the workarounds above until the npm bug is fixed.
|
|
|
644
573
|
- **OpenAI-Compatible** - OpenAI-compatible providers (OpenRouter, Together AI, etc.) with Claude API format
|
|
645
574
|
- **Universal API Format** - Use OpenAI-compatible providers (OpenRouter, Together AI, etc.) with Claude API format
|
|
646
575
|
- **Automatic Format Conversion** - Seamless conversion between Anthropic and OpenAI request/response formats
|
|
647
|
-
- **Model Mapping** - Map Claude models (
|
|
576
|
+
- **Model Mapping** - Map Claude models (opus, sonnet, haiku) to equivalent OpenAI models
|
|
648
577
|
- **Streaming Support** - Full support for streaming responses from OpenAI-compatible providers
|
|
649
578
|
- **API Key Authentication** - Secure API key management for OpenAI-compatible providers
|
|
650
579
|
- **Cost Tracking** - Automatic cost calculation for usage monitoring and budgeting
|
|
@@ -731,9 +660,7 @@ Inspired by [snipeship/ccflare](https://github.com/snipeship/ccflare) - thanks f
|
|
|
731
660
|
- [@anonym-uz](https://github.com/anonym-uz) - Critical auto-pause bug fix, analytics performance optimizations, request body truncation, and incremental vacuum implementation
|
|
732
661
|
- [@makhweeb](https://github.com/makhweeb) - Enhanced request handling and analytics improvements
|
|
733
662
|
- [@jw409](https://github.com/jw409) - Fixed OAuth account addition in WSL2 and compiled binaries by replacing unreliable prompt() with readline
|
|
734
|
-
- [@materemias](https://github.com/materemias) - Testing and validation of Vertex AI provider implementation, thorough debugging of OAuth API key authentication (issue #54)
|
|
735
|
-
- [@tqtensor](https://github.com/tqtensor) - Comprehensive memory leak fix preventing OOM kills with smart chunk capping, memory monitoring, and optimized cleanup (PR #67)
|
|
736
|
-
- [@lunetics](https://github.com/lunetics) - Force-reset rate limit feature allowing manual clearing of stale rate-limit locks via API, CLI, and dashboard with immediate usage polling (PR #68), OOM kill prevention with periodic data retention cleanup, 3-day default retention, and time-scoped stats queries (PR #70), model registry sync removing retired models and adding sonnet-4.6 CLI shortcut (PR #71)
|
|
663
|
+
- [@materemias](https://github.com/materemias) - Testing and validation of Vertex AI provider implementation, thorough debugging of OAuth API key authentication (issue #54), extensive testing of new releases and features including AWS Bedrock support
|
|
737
664
|
|
|
738
665
|
## Contributing
|
|
739
666
|
|
package/dist/better-ccflare
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,58 +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
|
-
|
|
2
|
+
"name": "better-ccflare",
|
|
3
|
+
"version": "3.2.0-beta10",
|
|
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 && 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 + '\\\";');\" && rm -f dist/better-ccflare && bun build src/main.ts --compile --outfile dist/better-ccflare --target=bun --minify --define __BETTER_CCFLARE_VERSION__='\\\"'$(node -p \"require('./package.json').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 --cwd ../.. build:dashboard && 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
|
+
}
|
|
58
58
|
}
|