forked from ericc-ch/copilot-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-controlled.bat
More file actions
46 lines (40 loc) · 1.61 KB
/
start-controlled.bat
File metadata and controls
46 lines (40 loc) · 1.61 KB
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
@echo off
TITLE Copilot Proxy - Controlled
echo ================================================
echo Copilot Proxy - Controlled
echo ================================================
echo.
:: Load environment variables from .env if it exists
if exist .env (
echo Loading environment from .env...
for /f "usebackq tokens=1,* delims==" %%A in (".env") do (
if not "%%A"=="" if not "%%A:~0,1%"=="#" (
set "%%A=%%B"
)
)
echo.
)
:: Build if dist/ doesn't exist
if not exist dist (
echo Building project...
bun run build
echo.
)
if defined TAVILY_API_KEY (
echo Web search: enabled ^(Tavily^)
) else if defined BRAVE_API_KEY (
echo Web search: enabled ^(Brave^)
) else (
echo Web search: disabled ^(set TAVILY_API_KEY or BRAVE_API_KEY in .env to enable^)
)
echo.
echo Starting server on http://localhost:3131
:: echo --burst-count 10 --burst-window 30 ^(max 10 requests per 30s window^)
echo.
echo To launch Claude Code, run in a new terminal:
:: echo set ANTHROPIC_BASE_URL=http://localhost:4141 ^& set ANTHROPIC_AUTH_TOKEN=dummy ^& set ANTHROPIC_MODEL=claude-opus-4.6 ^& set ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4.6 ^& set ANTHROPIC_SMALL_FAST_MODEL=gpt-4o-mini ^& set ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-opus-4.6 ^& set DISABLE_NON_ESSENTIAL_MODEL_CALLS=1 ^& set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 ^& claude
echo.
:: start "" "https://ericc-ch.github.io/copilot-api?endpoint=http://localhost:3131/usage"
bun run ./src/main.ts start --port 3131 --burst-count 300 --burst-window 30 --min-spacing 100 --burst-scope model
:: bun run ./src/main.ts start
pause