Compare commits
8 Commits
feature/ll
...
feature/co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ef82991fb | ||
|
|
f9ba3805a6 | ||
|
|
936f697110 | ||
|
|
b07bbd7d8c | ||
|
|
42f7d2da60 | ||
|
|
802bde2d76 | ||
|
|
b2db0307eb | ||
|
|
391cbd8334 |
@@ -9,3 +9,6 @@ screenshoots
|
||||
.env
|
||||
.blog
|
||||
docs
|
||||
.log
|
||||
blog
|
||||
config.json
|
||||
|
||||
@@ -115,6 +115,8 @@ ccr code
|
||||
- [x] Support change models
|
||||
- [x] Github Actions
|
||||
- [ ] More detailed logs
|
||||
- [ ] Support image
|
||||
- [ ] Support web search
|
||||
|
||||
## Github Actions
|
||||
|
||||
@@ -223,16 +225,15 @@ If you find this project helpful, you can choose to sponsor the author with a cu
|
||||
|
||||
## Sponsors
|
||||
|
||||
Thanks to the following sponsors:
|
||||
Thanks to the following sponsors for supporting the continued development of this project:
|
||||
|
||||
@Simon Leischnig (If you see this, feel free to contact me and I can update it with your GitHub information)
|
||||
[@duanshuaimin](https://github.com/duanshuaimin)
|
||||
[@vrgitadmin](https://github.com/vrgitadmin)
|
||||
@\*o (可通过主页邮箱联系我修改 github 用户名)
|
||||
@\*\*聪 (可通过主页邮箱联系我修改 github 用户名)
|
||||
[@ceilwoo](https://github.com/ceilwoo)
|
||||
@\*说 (可通过主页邮箱联系我修改 github 用户名)
|
||||
@\*更 (可通过主页邮箱联系我修改 github 用户名)
|
||||
@\*更 (可通过主页邮箱联系我修改 github 用户名)
|
||||
@K\*g (可通过主页邮箱联系我修改 github 用户名)
|
||||
@R\*R (可通过主页邮箱联系我修改 github 用户名)
|
||||
@[@bobleer](https://github.com/bobleer) (可通过主页邮箱联系我修改 github 用户名)
|
||||
|
||||
1001
package-lock.json
generated
1001
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@musistudio/claude-code-router",
|
||||
"version": "1.0.9",
|
||||
"version": "1.0.12",
|
||||
"description": "Use Claude Code without an Anthropics account and route it to another LLM provider",
|
||||
"bin": {
|
||||
"ccr": "./dist/cli.js"
|
||||
@@ -18,7 +18,7 @@
|
||||
"author": "musistudio",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@musistudio/llms": "^1.0.0",
|
||||
"@musistudio/llms": "^1.0.1",
|
||||
"dotenv": "^16.4.7",
|
||||
"tiktoken": "^1.0.21",
|
||||
"uuid": "^11.1.0"
|
||||
|
||||
10
pnpm-lock.yaml
generated
10
pnpm-lock.yaml
generated
@@ -9,8 +9,8 @@ importers:
|
||||
.:
|
||||
dependencies:
|
||||
'@musistudio/llms':
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0(ws@8.18.3)(zod@3.25.67)
|
||||
specifier: ^1.0.1
|
||||
version: 1.0.1(ws@8.18.3)(zod@3.25.67)
|
||||
dotenv:
|
||||
specifier: ^16.4.7
|
||||
version: 16.6.1
|
||||
@@ -214,8 +214,8 @@ packages:
|
||||
'@modelcontextprotocol/sdk':
|
||||
optional: true
|
||||
|
||||
'@musistudio/llms@1.0.0':
|
||||
resolution: {integrity: sha512-O5pSV3q3XOxP/8WsPLEJFoQ7gN7zZD6+hSW+5TgNlbJhXl1WImzI1ljjUm97efcZV93ij79/xz9GwwNzx/pjmA==}
|
||||
'@musistudio/llms@1.0.1':
|
||||
resolution: {integrity: sha512-ORA2dI92PgzOh0UfTg2DUjmWac9Iwi92Q7G6Bf2AQxYI9wsc/SO5vUhaH2QInjYhlNZC9AeK07wi+WjMopBeiQ==}
|
||||
|
||||
abstract-logging@2.0.1:
|
||||
resolution: {integrity: sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==}
|
||||
@@ -634,7 +634,7 @@ snapshots:
|
||||
- supports-color
|
||||
- utf-8-validate
|
||||
|
||||
'@musistudio/llms@1.0.0(ws@8.18.3)(zod@3.25.67)':
|
||||
'@musistudio/llms@1.0.1(ws@8.18.3)(zod@3.25.67)':
|
||||
dependencies:
|
||||
'@anthropic-ai/sdk': 0.54.0
|
||||
'@fastify/cors': 11.0.1
|
||||
|
||||
12
src/index.ts
12
src/index.ts
@@ -10,6 +10,7 @@ import {
|
||||
isServiceRunning,
|
||||
savePid,
|
||||
} from "./utils/processCheck";
|
||||
import { CONFIG_FILE } from "./constants";
|
||||
|
||||
async function initializeClaudeConfig() {
|
||||
const homeDir = process.env.HOME;
|
||||
@@ -69,10 +70,17 @@ async function run(options: RunOptions = {}) {
|
||||
? parseInt(process.env.SERVICE_PORT)
|
||||
: port;
|
||||
const server = createServer({
|
||||
...config,
|
||||
jsonPath: CONFIG_FILE,
|
||||
initialConfig: {
|
||||
// ...config,
|
||||
providers: config.Providers || config.providers,
|
||||
PORT: servicePort,
|
||||
LOG_FILE: join(homedir(), ".claude-code-router", "claude-code-router.log"),
|
||||
LOG_FILE: join(
|
||||
homedir(),
|
||||
".claude-code-router",
|
||||
"claude-code-router.log"
|
||||
),
|
||||
},
|
||||
});
|
||||
server.addHook("preHandler", async (req, reply) =>
|
||||
router(req, reply, config)
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import Server from "@musistudio/llms";
|
||||
|
||||
export const createServer = (config: any): Server => {
|
||||
const server = new Server({
|
||||
initialConfig: config,
|
||||
});
|
||||
const server = new Server(config);
|
||||
return server;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user