@aryacode/dsh-local-llm 0.8.5 → 0.8.7
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/lib/index.d.ts +11 -5
- package/lib/index.js +16 -10
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -1610,12 +1610,18 @@ declare const LIBRARY_PROVIDER = "local-library";
|
|
|
1610
1610
|
/**
|
|
1611
1611
|
* The per-request output default this adapter publishes for one model.
|
|
1612
1612
|
*
|
|
1613
|
-
*
|
|
1614
|
-
*
|
|
1615
|
-
*
|
|
1616
|
-
*
|
|
1613
|
+
* It scales with the window the engine actually serves: a share of it, floored
|
|
1614
|
+
* at 1,024 tokens and bounded by the engine's own allowance when one is known.
|
|
1615
|
+
* A fixed 8K used to cap every model here, which silently truncated long answers
|
|
1616
|
+
* and made a 100K- or 256K-token engine behave like an 8K one.
|
|
1617
|
+
*
|
|
1618
|
+
* @param context - the model's served context window in tokens.
|
|
1619
|
+
* @param ceiling - the engine's maximum response allowance, when it declares one.
|
|
1620
|
+
* @param divisor - the share of the window the answer may use: 4 for the Strata
|
|
1621
|
+
* engines; 3 for NInfer, whose 100K window needs 34,133 for a whole file (a
|
|
1622
|
+
* 25,600 quarter cut a measured 25,690-token page write by 90 tokens).
|
|
1617
1623
|
*/
|
|
1618
|
-
declare function outputDefault(context: number, ceiling?: number): number;
|
|
1624
|
+
declare function outputDefault(context: number, ceiling?: number, divisor?: number): number;
|
|
1619
1625
|
/** Where the Strata engine's own OpenAI-compatible surface answers, and how to authorize it. */
|
|
1620
1626
|
interface StrataModelSource {
|
|
1621
1627
|
/** Engine base URL, without a trailing slash, e.g. `http://127.0.0.1:8080`. */
|
package/lib/index.js
CHANGED
|
@@ -2605,13 +2605,19 @@ const LIBRARY_PROVIDER = "local-library";
|
|
|
2605
2605
|
/**
|
|
2606
2606
|
* The per-request output default this adapter publishes for one model.
|
|
2607
2607
|
*
|
|
2608
|
-
*
|
|
2609
|
-
*
|
|
2610
|
-
*
|
|
2611
|
-
*
|
|
2608
|
+
* It scales with the window the engine actually serves: a share of it, floored
|
|
2609
|
+
* at 1,024 tokens and bounded by the engine's own allowance when one is known.
|
|
2610
|
+
* A fixed 8K used to cap every model here, which silently truncated long answers
|
|
2611
|
+
* and made a 100K- or 256K-token engine behave like an 8K one.
|
|
2612
|
+
*
|
|
2613
|
+
* @param context - the model's served context window in tokens.
|
|
2614
|
+
* @param ceiling - the engine's maximum response allowance, when it declares one.
|
|
2615
|
+
* @param divisor - the share of the window the answer may use: 4 for the Strata
|
|
2616
|
+
* engines; 3 for NInfer, whose 100K window needs 34,133 for a whole file (a
|
|
2617
|
+
* 25,600 quarter cut a measured 25,690-token page write by 90 tokens).
|
|
2612
2618
|
*/
|
|
2613
|
-
function outputDefault(context, ceiling =
|
|
2614
|
-
return Math.max(1024, Math.min(ceiling,
|
|
2619
|
+
function outputDefault(context, ceiling = Number.POSITIVE_INFINITY, divisor = 4) {
|
|
2620
|
+
return Math.max(1024, Math.min(ceiling, Math.floor(context / divisor)));
|
|
2615
2621
|
}
|
|
2616
2622
|
/** Thinking levels a chat-template engine can be asked for through its template kwargs. */
|
|
2617
2623
|
const strataReasoning = {
|
|
@@ -2660,9 +2666,9 @@ function libraryAdapter(controller, ensure, gate, checkIdle, attachments, strata
|
|
|
2660
2666
|
* The label the other Arya engines show: `qwen3.8-27b` becomes `Arya - Qwen3.8 27B`.
|
|
2661
2667
|
*
|
|
2662
2668
|
* The model list is what a person reads in the picker, so a bare artifact id is
|
|
2663
|
-
* a poor label next to the existing `Arya -
|
|
2664
|
-
* capitalised, and a lowercase letter that follows a trailing digit
|
|
2665
|
-
* quantisation suffix such as `27b`
|
|
2669
|
+
* a poor label next to the existing `Arya - …` entries. Each segment is
|
|
2670
|
+
* capitalised, and a lowercase letter that follows a trailing digit — a size or
|
|
2671
|
+
* quantisation suffix such as `27b` — is uppercased the way these artifacts are
|
|
2666
2672
|
* written on the tin.
|
|
2667
2673
|
*/
|
|
2668
2674
|
const aryaLabel = (name) => "Arya - " + name.split(/[-_]/u).filter((part) => part !== "").map((part) => {
|
|
@@ -2726,7 +2732,7 @@ function libraryAdapter(controller, ensure, gate, checkIdle, attachments, strata
|
|
|
2726
2732
|
if (typeof state.modelName === "string" && state.modelName !== "") {
|
|
2727
2733
|
const model = {
|
|
2728
2734
|
...info("ninfer:" + state.modelName, aryaLabel(state.modelName), Number(state.context) || 8192, state.vision === true, "ninfer", state.modelName),
|
|
2729
|
-
defaultMaxTokens: outputDefault(Number(state.context) || 8192, ninfer.outputTokens()),
|
|
2735
|
+
defaultMaxTokens: outputDefault(Number(state.context) || 8192, ninfer.outputTokens(), 3),
|
|
2730
2736
|
reasoning: ninferReasoning
|
|
2731
2737
|
};
|
|
2732
2738
|
models.push(model);
|