rebellm-bridge 0.1.2 → 0.1.3
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 +4 -2
- package/dist/cli.js +2 -2
- package/dist/launcher.d.ts +6 -0
- package/dist/launcher.js +13 -4
- package/dist/mcp.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ npm install -g rebellm-bridge # or run it once with: npx rebellm-bridge
|
|
|
21
21
|
|
|
22
22
|
1. `rebellm-bridge` — the first start prints a token once and keeps it in
|
|
23
23
|
`~/.rebellm-bridge/token` (`cat` it to see it again, delete it for a new one).
|
|
24
|
-
2. In RebeLLM:
|
|
24
|
+
2. In RebeLLM: Bridge (top of the page) → paste the token, Save, switch on. The sidebar reads
|
|
25
25
|
"Connected to 127.0.0.1:7343". The model must be loaded in that tab.
|
|
26
26
|
3. Check: `curl http://127.0.0.1:7343/health` → `{"tab":true,"state":"ready",...}`.
|
|
27
27
|
|
|
@@ -63,7 +63,9 @@ It reuses a running bridge or starts one, waits for the tab, sets the tab's cont
|
|
|
63
63
|
and a long request timeout, and passes every other argument to `claude`. Options:
|
|
64
64
|
`--claude <path>`, `--shared-config` (use your normal Claude Code config), `--port <n>`.
|
|
65
65
|
Claude Code's first request is ~11k tokens of system prompt and tools, so it needs a tab
|
|
66
|
-
with a 32k context and patience on a slow GPU
|
|
66
|
+
with a 32k context and patience on a slow GPU: the launcher raises Claude Code's request
|
|
67
|
+
and subagent timeouts to hours, so a subagent that shows nothing for twenty minutes is
|
|
68
|
+
prefilling, not stuck (the Bridge log in the tab shows it).
|
|
67
69
|
|
|
68
70
|
On a work machine Claude Code may be pinned to the company's endpoint or cloud provider.
|
|
69
71
|
The launcher blanks `ANTHROPIC_API_KEY`, `ANTHROPIC_CUSTOM_HEADERS` and `CLAUDE_CODE_USE_*`
|
package/dist/cli.js
CHANGED
|
@@ -117,7 +117,7 @@ export async function run(o, io) {
|
|
|
117
117
|
});
|
|
118
118
|
if (tok.created)
|
|
119
119
|
say(`\nNew bridge token (stored in ${tok.file}):\n\n ${tok.token}\n\n` +
|
|
120
|
-
'Paste it into RebeLLM →
|
|
120
|
+
'Paste it into RebeLLM → Bridge and turn the switch on. It is printed only this once.\n');
|
|
121
121
|
const warning = hostWarning(o.host);
|
|
122
122
|
if (warning)
|
|
123
123
|
log(warning);
|
|
@@ -142,7 +142,7 @@ export async function run(o, io) {
|
|
|
142
142
|
if (server) {
|
|
143
143
|
const where = `${urlHost(o.host)}:${server.port}`;
|
|
144
144
|
log(`${VERSION} listening on ${where}`);
|
|
145
|
-
say(` tab: ws://${where} (RebeLLM →
|
|
145
|
+
say(` tab: ws://${where} (RebeLLM → Bridge)`);
|
|
146
146
|
say(` OpenAI: http://${where}/v1`);
|
|
147
147
|
say(` Claude: http://${where} (Anthropic API; rebellm-claude runs Claude Code on it)`);
|
|
148
148
|
say(` token: ${tok.source === 'flag' ? 'from --token' : tok.source === 'env' ? `from ${TOKEN_ENV}` : `in ${tok.file}`}`);
|
package/dist/launcher.d.ts
CHANGED
|
@@ -25,6 +25,12 @@ export declare const configDir: (home: string) => string;
|
|
|
25
25
|
export declare const logFile: (home: string) => string;
|
|
26
26
|
/** Given to claude as `--settings`, which ranks above project, local and user settings. */
|
|
27
27
|
export declare const launchSettingsFile: (home: string) => string;
|
|
28
|
+
/** Claude Code's extra model calls, minutes each on a slow model: the recap on return, prompt suggestions, thinking summaries. */
|
|
29
|
+
export declare const QUIET_SETTINGS: {
|
|
30
|
+
readonly awaySummaryEnabled: false;
|
|
31
|
+
readonly promptSuggestionEnabled: false;
|
|
32
|
+
readonly showThinkingSummaries: false;
|
|
33
|
+
};
|
|
28
34
|
export declare function writeLaunchSettings(file: string, env: Record<string, string>): void;
|
|
29
35
|
/** Where an organisation's Claude Code settings live; they rank above everything the launcher can do. */
|
|
30
36
|
export declare function managedSettingsFile(platform: NodeJS.Platform, env: NodeJS.ProcessEnv): string;
|
package/dist/launcher.js
CHANGED
|
@@ -106,8 +106,11 @@ export function bridgeEnv(base, contextTokens) {
|
|
|
106
106
|
ANTHROPIC_MODEL: MODEL,
|
|
107
107
|
ANTHROPIC_SMALL_FAST_MODEL: MODEL,
|
|
108
108
|
ANTHROPIC_DEFAULT_HAIKU_MODEL: MODEL,
|
|
109
|
-
// A
|
|
110
|
-
|
|
109
|
+
// A 32k prefill at 26 tok/s is 21 minutes and a long answer at 1.5 tok/s hours; the
|
|
110
|
+
// bridge's pings keep the idle watchdogs quiet, these keep the request and subagent alive.
|
|
111
|
+
API_TIMEOUT_MS: '21600000',
|
|
112
|
+
CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS: '21600000',
|
|
113
|
+
CLAUDE_STREAM_IDLE_TIMEOUT_MS: '1800000',
|
|
111
114
|
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: '1',
|
|
112
115
|
// Claude Code assumes 200k for a model it does not know; it should compact within the tab's.
|
|
113
116
|
...(contextTokens ? { CLAUDE_CODE_MAX_CONTEXT_TOKENS: String(contextTokens) } : {}),
|
|
@@ -128,9 +131,15 @@ export const logFile = (home) => join(home, '.rebellm-bridge', 'bridge.log');
|
|
|
128
131
|
/** Given to claude as `--settings`, which ranks above project, local and user settings. */
|
|
129
132
|
export const launchSettingsFile = (home) => join(home, '.rebellm-bridge', 'claude-settings.json');
|
|
130
133
|
const isObj = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
134
|
+
/** Claude Code's extra model calls, minutes each on a slow model: the recap on return, prompt suggestions, thinking summaries. */
|
|
135
|
+
export const QUIET_SETTINGS = {
|
|
136
|
+
awaySummaryEnabled: false,
|
|
137
|
+
promptSuggestionEnabled: false,
|
|
138
|
+
showThinkingSummaries: false,
|
|
139
|
+
};
|
|
131
140
|
export function writeLaunchSettings(file, env) {
|
|
132
141
|
mkdirSync(dirname(file), { recursive: true, mode: 0o700 });
|
|
133
|
-
writeFileSync(file, `${JSON.stringify({ env }, null, 2)}\n`, { mode: 0o600 });
|
|
142
|
+
writeFileSync(file, `${JSON.stringify({ ...QUIET_SETTINGS, env }, null, 2)}\n`, { mode: 0o600 });
|
|
134
143
|
}
|
|
135
144
|
/** Where an organisation's Claude Code settings live; they rank above everything the launcher can do. */
|
|
136
145
|
export function managedSettingsFile(platform, env) {
|
|
@@ -222,7 +231,7 @@ export async function launch(argv, io) {
|
|
|
222
231
|
}
|
|
223
232
|
}
|
|
224
233
|
if (!health?.tab) {
|
|
225
|
-
say(`waiting for the RebeLLM tab. In RebeLLM →
|
|
234
|
+
say(`waiting for the RebeLLM tab. In RebeLLM → Bridge, connect to ` +
|
|
226
235
|
`${base.replace('http:', 'ws:')} with ${token}\nCtrl+C quits.`);
|
|
227
236
|
while (!health?.tab) {
|
|
228
237
|
if (quit.signal.aborted)
|
package/dist/mcp.js
CHANGED
|
@@ -92,7 +92,7 @@ export function httpBackend(base) {
|
|
|
92
92
|
/** The `status` tool's text; never the token, which would end up in the client's context. */
|
|
93
93
|
export function describeHealth(h) {
|
|
94
94
|
if (!h.tab)
|
|
95
|
-
return ('No RebeLLM tab is connected. In RebeLLM →
|
|
95
|
+
return ('No RebeLLM tab is connected. In RebeLLM → Bridge, paste the bridge token ' +
|
|
96
96
|
'(printed at its first start, stored in ~/.rebellm-bridge/token) and turn the switch on.');
|
|
97
97
|
const tab = `A RebeLLM tab is connected${h.app ? ` (app ${h.app})` : ''}.`;
|
|
98
98
|
const model = h.model ? `The model ${h.model}` : 'The model';
|