@ljoukov/llm 3.0.3 → 3.0.4
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 +24 -0
- package/dist/index.cjs +1035 -121
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +1035 -121
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -107,6 +107,20 @@ to HTTP/SSE automatically when needed.
|
|
|
107
107
|
When fallback is triggered by an unsupported WebSocket upgrade response (for example `426`), the library keeps using
|
|
108
108
|
SSE for the rest of the process to avoid repeated failing upgrade attempts.
|
|
109
109
|
|
|
110
|
+
### Adaptive per-model concurrency
|
|
111
|
+
|
|
112
|
+
Provider calls use adaptive, overload-aware concurrency (with retry/backoff where supported). Configure hard caps per
|
|
113
|
+
model/per binary with env vars (clamped to `1..64`, default `3`):
|
|
114
|
+
|
|
115
|
+
- global cap: `LLM_MAX_PARALLEL_REQUESTS_PER_MODEL`
|
|
116
|
+
- provider caps: `OPENAI_MAX_PARALLEL_REQUESTS_PER_MODEL`, `GOOGLE_MAX_PARALLEL_REQUESTS_PER_MODEL`,
|
|
117
|
+
`FIREWORKS_MAX_PARALLEL_REQUESTS_PER_MODEL`
|
|
118
|
+
- model overrides:
|
|
119
|
+
- `LLM_MAX_PARALLEL_REQUESTS_MODEL_<MODEL>`
|
|
120
|
+
- `<PROVIDER>_MAX_PARALLEL_REQUESTS_MODEL_<MODEL>`
|
|
121
|
+
|
|
122
|
+
`<MODEL>` is uppercased and non-alphanumeric characters become `_` (for example `gpt-5.2` -> `GPT_5_2`).
|
|
123
|
+
|
|
110
124
|
## Usage
|
|
111
125
|
|
|
112
126
|
`v2` uses OpenAI-style request fields:
|
|
@@ -464,6 +478,11 @@ Confinement/policy is set through `filesystemTool.options`:
|
|
|
464
478
|
|
|
465
479
|
Detailed reference: `docs/agent-filesystem-tools.md`.
|
|
466
480
|
|
|
481
|
+
Subagent delegation can be enabled via `subagentTool` (Codex-style control tools):
|
|
482
|
+
|
|
483
|
+
- `spawn_agent`, `send_input`, `resume_agent`, `wait`, `close_agent`
|
|
484
|
+
- Optional limits: `maxAgents`, `maxDepth`, wait timeouts.
|
|
485
|
+
|
|
467
486
|
```ts
|
|
468
487
|
import { createInMemoryAgentFilesystem, runAgentLoop } from "@ljoukov/llm";
|
|
469
488
|
|
|
@@ -481,6 +500,11 @@ const result = await runAgentLoop({
|
|
|
481
500
|
fs,
|
|
482
501
|
},
|
|
483
502
|
},
|
|
503
|
+
subagentTool: {
|
|
504
|
+
enabled: true,
|
|
505
|
+
maxAgents: 4,
|
|
506
|
+
maxDepth: 2,
|
|
507
|
+
},
|
|
484
508
|
});
|
|
485
509
|
|
|
486
510
|
console.log(result.text);
|