akm-cli 0.9.15-beta.2 → 0.9.15-beta.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/CHANGELOG.md +60 -1
- package/dist/cli.js +3 -3
- package/dist/commands/health/checks.js +11 -2
- package/dist/commands/health/scheduler-binary.js +120 -0
- package/dist/commands/health.js +9 -0
- package/dist/core/config/schema/embedding.js +2 -3
- package/dist/core/errors.js +1 -0
- package/dist/indexer/indexer.js +44 -3
- package/dist/indexer/materialize-embeddings.js +51 -9
- package/dist/llm/embedders/remote.js +106 -8
- package/dist/scripts/akm-migrate-node.js +61 -13
- package/dist/scripts/akm-migrate.js +61 -13
- package/docs/migration/release-notes/0.9.15.md +18 -0
- package/docs/reference/cli.md +27 -5
- package/docs/reference/configuration.md +21 -5
- package/package.json +1 -1
- package/schemas/akm-config.json +0 -12
|
@@ -396,8 +396,8 @@ unless a remote `embedding` config is provided.
|
|
|
396
396
|
`akm improve`'s memory-inference/consolidate passes when they call an
|
|
397
397
|
embedding model: `provider`, `endpoint`, `model`, `apiKey` (symbolic
|
|
398
398
|
reference, same rules as engine `apiKey`), `dimension`, `localModel`,
|
|
399
|
-
`maxInputTokens`, `maxTokens`, `batchSize`, `
|
|
400
|
-
`
|
|
399
|
+
`maxInputTokens`, `maxTokens`, `batchSize`, `contextLength`, `timeoutMs`,
|
|
400
|
+
`concurrency`, and `ollamaOptions.num_ctx`.
|
|
401
401
|
|
|
402
402
|
The knobs that bound request/document size and rate, all optional (defaults
|
|
403
403
|
apply when unset), for a remote endpoint (`src/llm/embedders/remote.ts`):
|
|
@@ -405,7 +405,7 @@ apply when unset), for a remote endpoint (`src/llm/embedders/remote.ts`):
|
|
|
405
405
|
| Key | Default | Bounds |
|
|
406
406
|
| --- | --- | --- |
|
|
407
407
|
| `embedding.maxInputTokens` | `512` | Per-DOCUMENT cap, applied before batching (#956). A document's embedded text is truncated to its head (unicode-safe) at this many estimated tokens instead of ever being skipped for size alone — a document is skipped only when its truncated head is empty. |
|
|
408
|
-
| `embedding.maxTokens` | `
|
|
408
|
+
| `embedding.maxTokens` | `6000` (`DEFAULT_TOKEN_BUDGET`) | Per-REQUEST token budget: how many (already-capped) documents' estimated tokens fit in one HTTP request. With the 512-token default document cap, a request carries about 11 documents by default. Lowered from 8000 to 6000 (#954): the 4-chars-per-token estimator undercounts dense technical text by 7-55%, so 8000 regularly overshot an 8192-token endpoint's real context window. |
|
|
409
409
|
| `embedding.batchSize` | `100` | Per-REQUEST document-COUNT safety cap, independent of the token budget — guards against many tiny documents packing an oversized request. |
|
|
410
410
|
| `embedding.contextLength` | unset | Ollama's `num_ctx` ONLY, forwarded verbatim as `options.num_ctx` on the native `/api/embed` request. Does **not** feed the request token budget above (#956) — the two used to share this one field, so setting it for the server's context window silently changed request batching too. |
|
|
411
411
|
| `embedding.timeoutMs` | `120000` (120s) | Per-request wall timeout — see below. |
|
|
@@ -421,6 +421,18 @@ dead endpoint is still detected in seconds on the common case of small
|
|
|
421
421
|
documents. Set `embedding.timeoutMs` lower to fail fast against a
|
|
422
422
|
known-fast endpoint, or higher for a slow local server on large batches.
|
|
423
423
|
|
|
424
|
+
`embedding.maxTokens` (or its default) is also a run-scoped adaptive
|
|
425
|
+
starting point, not a hard ceiling (#954): on the FIRST rejection of an
|
|
426
|
+
`akm index` run for exceeding the endpoint's context window, akm shrinks
|
|
427
|
+
the request budget to three quarters of its current value — floored at
|
|
428
|
+
twice `embedding.maxInputTokens` — for every request not yet sent, and
|
|
429
|
+
prints one line naming the new value. This never changes the rejected
|
|
430
|
+
request's own split-and-retry (below), never shrinks a second time in the
|
|
431
|
+
same run, and never grows the budget back up. Users who set
|
|
432
|
+
`embedding.maxTokens` explicitly are unaffected by the LOWERED DEFAULT
|
|
433
|
+
above but still benefit from this same-run recovery if their own value
|
|
434
|
+
turns out to be too high for the endpoint.
|
|
435
|
+
|
|
424
436
|
A request TIMEOUT (not a rejection for exceeding the context window) never
|
|
425
437
|
drops its batch immediately: field confirmation showed that once akm
|
|
426
438
|
abandons a timed-out request, the endpoint (e.g. llama-server) keeps
|
|
@@ -447,10 +459,10 @@ serves parallel requests — a local server started with a multi-slot flag
|
|
|
447
459
|
single-slot model server, which the default already protects from
|
|
448
460
|
reload-thrash. Request SIZE remains the first throughput lever regardless:
|
|
449
461
|
`embedding.batchSize` (a document-count cap, default 100) together with
|
|
450
|
-
`embedding.maxTokens` (an estimated token budget per request, default
|
|
462
|
+
`embedding.maxTokens` (an estimated token budget per request, default 6000
|
|
451
463
|
— NOT `embedding.contextLength`, see the table above) control how many
|
|
452
464
|
documents land in one request — with the default 512-token
|
|
453
|
-
`embedding.maxInputTokens` document cap, that is about
|
|
465
|
+
`embedding.maxInputTokens` document cap, that is about 11 documents,
|
|
454
466
|
taking about the same wall time as a single one against a healthy endpoint.
|
|
455
467
|
|
|
456
468
|
## Search tuning
|
|
@@ -737,3 +749,7 @@ network filesystem for the data directory and falls back to `DELETE`.
|
|
|
737
749
|
configuration using `engines`, `defaults.engine`, `defaults.llmEngine`, and
|
|
738
750
|
`improve.strategies`; AKM deliberately does not infer or rename ambiguous
|
|
739
751
|
profile identities.
|
|
752
|
+
|
|
753
|
+
`embedding.chunkSize` was never read by anything under `src/` (#954), so a
|
|
754
|
+
config that still sets it is simply ignored — it still loads, unvalidated
|
|
755
|
+
and without warning.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "akm-cli",
|
|
3
|
-
"version": "0.9.15-beta.
|
|
3
|
+
"version": "0.9.15-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "akm (Agent Knowledge Manager) — a portable, local-first capability library for AI agents. Discover, load, share, and improve reusable skills, scripts, workflows, and knowledge across any shell-capable coding agent, including Claude Code, OpenCode, and Cursor.",
|
|
6
6
|
"keywords": [
|
package/schemas/akm-config.json
CHANGED
|
@@ -223,10 +223,6 @@
|
|
|
223
223
|
"type": "integer",
|
|
224
224
|
"exclusiveMinimum": 0
|
|
225
225
|
},
|
|
226
|
-
"chunkSize": {
|
|
227
|
-
"type": "integer",
|
|
228
|
-
"exclusiveMinimum": 0
|
|
229
|
-
},
|
|
230
226
|
"contextLength": {
|
|
231
227
|
"type": "integer",
|
|
232
228
|
"exclusiveMinimum": 0
|
|
@@ -1927,10 +1923,6 @@
|
|
|
1927
1923
|
"type": "integer",
|
|
1928
1924
|
"exclusiveMinimum": 0
|
|
1929
1925
|
},
|
|
1930
|
-
"chunkSize": {
|
|
1931
|
-
"type": "integer",
|
|
1932
|
-
"exclusiveMinimum": 0
|
|
1933
|
-
},
|
|
1934
1926
|
"contextLength": {
|
|
1935
1927
|
"type": "integer",
|
|
1936
1928
|
"exclusiveMinimum": 0
|
|
@@ -3509,10 +3501,6 @@
|
|
|
3509
3501
|
"type": "integer",
|
|
3510
3502
|
"exclusiveMinimum": 0
|
|
3511
3503
|
},
|
|
3512
|
-
"chunkSize": {
|
|
3513
|
-
"type": "integer",
|
|
3514
|
-
"exclusiveMinimum": 0
|
|
3515
|
-
},
|
|
3516
3504
|
"contextLength": {
|
|
3517
3505
|
"type": "integer",
|
|
3518
3506
|
"exclusiveMinimum": 0
|