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