adaptive-memory-multi-model-router 2.16.2 → 2.16.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 +17 -0
- package/data/jev-distill.jsonl +320 -0
- package/dist/routing/jev/jevRouter.d.ts +49 -0
- package/dist/routing/jev/jevRouter.js +231 -0
- package/dist/routing/jev/jevRouter.js.map +1 -0
- package/dist/routing/jev/optionAttention.d.ts +63 -0
- package/dist/routing/jev/optionAttention.js +158 -0
- package/dist/routing/jev/optionAttention.js.map +1 -0
- package/dist/routing/jev/remote.d.ts +14 -0
- package/dist/routing/jev/remote.js +55 -0
- package/dist/routing/jev/remote.js.map +1 -0
- package/dist/routing/jev/types.d.ts +71 -0
- package/dist/routing/jev/types.js +19 -0
- package/dist/routing/jev/types.js.map +1 -0
- package/dist/routing/jev/weights/jev-router-weights.json +1 -0
- package/dist/server/modelMapper.js +18 -0
- package/dist/server/modelMapper.js.map +1 -1
- package/package.json +4 -2
- package/python/pyproject.toml +1 -1
- package/src/cli/setupWizard.ts +4 -2
- package/src/routing/jev/jevRouter.ts +251 -0
- package/src/routing/jev/optionAttention.ts +186 -0
- package/src/routing/jev/remote.ts +50 -0
- package/src/routing/jev/types.ts +79 -0
- package/src/routing/jev/weights/jev-router-weights.json +1 -0
- package/src/server/modelMapper.ts +17 -0
- package/tests/routing/jev.test.ts +110 -0
- package/tools/calibrate_temp.py +81 -0
- package/tools/distill.mjs +143 -0
- package/tools/train_jev.py +213 -0
- package/dist/cli/tui.d.ts +0 -6
- package/dist/cli/tui.js.map +0 -1
- package/dist/routing/shadowSampler.d.ts.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jev contract — open interface pattern for System One decision models.
|
|
3
|
+
*
|
|
4
|
+
* Follows the interface reproduced by the open community:
|
|
5
|
+
* - TheoLeeCJ/SemIf (formerly OpenJev, 1.4k★) — typed option probabilities
|
|
6
|
+
* - ekzhang/openjev-sglang — faithful TypeSafe/Jev HTTP API server
|
|
7
|
+
* - vinnylarouge/jevlike — trainable context+options→probabilities engine
|
|
8
|
+
*
|
|
9
|
+
* Three question types (per TypeSafe's Jev):
|
|
10
|
+
* - choice: categorical pick over N options → calibrated probs
|
|
11
|
+
* - score: numeric value in [0,1] → sigmoid output
|
|
12
|
+
* - noul: boolean with calibrated probability → 2-way choice
|
|
13
|
+
*
|
|
14
|
+
* A3M usage: one request answers provider routing (choice),
|
|
15
|
+
* query complexity (score), and capability flags (noul) in a single pass.
|
|
16
|
+
*/
|
|
17
|
+
export type JevQuestionType = "choice" | "score" | "noul";
|
|
18
|
+
export interface JevChoiceQuestion {
|
|
19
|
+
type: "choice";
|
|
20
|
+
key: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
/** Dynamic option texts — engine scores unseen options via their text. */
|
|
23
|
+
options: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface JevScoreQuestion {
|
|
26
|
+
type: "score";
|
|
27
|
+
key: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
min?: number;
|
|
30
|
+
max?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface JevNoulQuestion {
|
|
33
|
+
type: "noul";
|
|
34
|
+
key: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
}
|
|
37
|
+
export type JevQuestion = JevChoiceQuestion | JevScoreQuestion | JevNoulQuestion;
|
|
38
|
+
export interface JevRequest {
|
|
39
|
+
/** Unstructured state — the user prompt / conversation context. */
|
|
40
|
+
state: string;
|
|
41
|
+
questions: JevQuestion[];
|
|
42
|
+
}
|
|
43
|
+
export interface JevChoiceAnswer {
|
|
44
|
+
type: "choice";
|
|
45
|
+
key: string;
|
|
46
|
+
value: string;
|
|
47
|
+
prob: number;
|
|
48
|
+
top: Array<{
|
|
49
|
+
option: string;
|
|
50
|
+
prob: number;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
export interface JevScoreAnswer {
|
|
54
|
+
type: "score";
|
|
55
|
+
key: string;
|
|
56
|
+
value: number;
|
|
57
|
+
}
|
|
58
|
+
export interface JevNoulAnswer {
|
|
59
|
+
type: "noul";
|
|
60
|
+
key: string;
|
|
61
|
+
value: boolean;
|
|
62
|
+
prob: number;
|
|
63
|
+
}
|
|
64
|
+
export type JevAnswer = JevChoiceAnswer | JevScoreAnswer | JevNoulAnswer;
|
|
65
|
+
export interface JevResponse {
|
|
66
|
+
answers: JevAnswer[];
|
|
67
|
+
/** Milliseconds spent in the decision engine (excluding fallbacks). */
|
|
68
|
+
elapsed_ms: number;
|
|
69
|
+
/** Which backend produced the answers. */
|
|
70
|
+
backend: "local-weights" | "remote" | "fallback-heuristic";
|
|
71
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Jev contract — open interface pattern for System One decision models.
|
|
4
|
+
*
|
|
5
|
+
* Follows the interface reproduced by the open community:
|
|
6
|
+
* - TheoLeeCJ/SemIf (formerly OpenJev, 1.4k★) — typed option probabilities
|
|
7
|
+
* - ekzhang/openjev-sglang — faithful TypeSafe/Jev HTTP API server
|
|
8
|
+
* - vinnylarouge/jevlike — trainable context+options→probabilities engine
|
|
9
|
+
*
|
|
10
|
+
* Three question types (per TypeSafe's Jev):
|
|
11
|
+
* - choice: categorical pick over N options → calibrated probs
|
|
12
|
+
* - score: numeric value in [0,1] → sigmoid output
|
|
13
|
+
* - noul: boolean with calibrated probability → 2-way choice
|
|
14
|
+
*
|
|
15
|
+
* A3M usage: one request answers provider routing (choice),
|
|
16
|
+
* query complexity (score), and capability flags (noul) in a single pass.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/routing/jev/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG"}
|