@tensor-cad/mcp 0.1.0
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 +217 -0
- package/bridge/protocol.d.ts +99 -0
- package/bridge/server.d.ts +106 -0
- package/bridge/session.d.ts +24 -0
- package/design-schema.d.ts +198 -0
- package/index.d.ts +16 -0
- package/index.js +2874 -0
- package/mcp.example.json +12 -0
- package/ops.d.ts +69 -0
- package/package.json +37 -0
- package/prompts.d.ts +12 -0
- package/resources.d.ts +11 -0
- package/schemas.d.ts +291 -0
- package/serve.d.ts +11 -0
- package/serve.js +2867 -0
- package/server.d.ts +31 -0
- package/server.json +32 -0
- package/stdio.d.ts +10 -0
- package/stdio.js +2869 -0
- package/store/file-store.d.ts +58 -0
- package/store/types.d.ts +119 -0
- package/summarize.d.ts +128 -0
- package/tools.d.ts +12 -0
package/mcp.example.json
ADDED
package/ops.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Doc, Graph, ParamValue } from "@tensor-cad/engine";
|
|
2
|
+
/**
|
|
3
|
+
* The edit operations an agent can apply to a design.
|
|
4
|
+
*
|
|
5
|
+
* One patch tool beats thirty setters: it keeps the tool count under the caps
|
|
6
|
+
* some clients impose, and a batch either lands whole or not at all, so a
|
|
7
|
+
* half-applied edit can never be observed.
|
|
8
|
+
*/
|
|
9
|
+
export type Op = {
|
|
10
|
+
op: "add_node";
|
|
11
|
+
/** Container node whose subgraph receives the block. Empty or absent means the root graph. */
|
|
12
|
+
parent?: string;
|
|
13
|
+
id: string;
|
|
14
|
+
type: string;
|
|
15
|
+
params?: Record<string, ParamValue>;
|
|
16
|
+
label?: string;
|
|
17
|
+
} | {
|
|
18
|
+
op: "remove_node";
|
|
19
|
+
path: string;
|
|
20
|
+
} | {
|
|
21
|
+
op: "set_param";
|
|
22
|
+
path: string;
|
|
23
|
+
key: string;
|
|
24
|
+
value: ParamValue;
|
|
25
|
+
} | {
|
|
26
|
+
op: "connect";
|
|
27
|
+
graph?: string;
|
|
28
|
+
from: string;
|
|
29
|
+
to: string;
|
|
30
|
+
} | {
|
|
31
|
+
op: "disconnect";
|
|
32
|
+
graph?: string;
|
|
33
|
+
from: string;
|
|
34
|
+
to: string;
|
|
35
|
+
} | {
|
|
36
|
+
op: "set_symbol";
|
|
37
|
+
name: string;
|
|
38
|
+
value: number | string | null;
|
|
39
|
+
doc?: string;
|
|
40
|
+
runtime?: boolean;
|
|
41
|
+
} | {
|
|
42
|
+
op: "rename";
|
|
43
|
+
path: string;
|
|
44
|
+
id: string;
|
|
45
|
+
} | {
|
|
46
|
+
op: "set_label";
|
|
47
|
+
path: string;
|
|
48
|
+
label?: string | null;
|
|
49
|
+
};
|
|
50
|
+
/** A rejected operation. The message is meant to be read by a model. */
|
|
51
|
+
export declare class OpError extends Error {
|
|
52
|
+
readonly index: number;
|
|
53
|
+
readonly op: Op;
|
|
54
|
+
constructor(index: number, op: Op, message: string);
|
|
55
|
+
}
|
|
56
|
+
/** The graph identified by a container path; the empty string is the root. */
|
|
57
|
+
export declare function graphAt(doc: Doc, path: string | undefined): Graph;
|
|
58
|
+
/** Every node path in the document, parents before children. */
|
|
59
|
+
export declare function allPaths(graph: Graph, prefix?: string, out?: string[]): string[];
|
|
60
|
+
export interface ApplyResult {
|
|
61
|
+
doc: Doc;
|
|
62
|
+
/** One human-readable line per operation, in order. */
|
|
63
|
+
applied: string[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Apply a batch to a copy of the document. The original is never touched, and
|
|
67
|
+
* the first failing operation aborts the whole batch.
|
|
68
|
+
*/
|
|
69
|
+
export declare function applyOps(doc: Doc, ops: Op[]): ApplyResult;
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tensor-cad/mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Model Context Protocol server for TensorCAD: design, validate, analyze and generate LLM architectures from an agent",
|
|
5
|
+
"mcpName": "io.github.filip-pajalic/tensorcad",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"types": "./index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./index.d.ts",
|
|
12
|
+
"import": "./index.js"
|
|
13
|
+
},
|
|
14
|
+
"./server": {
|
|
15
|
+
"types": "./server.d.ts",
|
|
16
|
+
"import": "./server.js"
|
|
17
|
+
},
|
|
18
|
+
"./stdio": {
|
|
19
|
+
"types": "./stdio.d.ts",
|
|
20
|
+
"import": "./stdio.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"bin": {
|
|
24
|
+
"tensorcad-mcp": "./stdio.js"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@modelcontextprotocol/server": "^2.0.0",
|
|
28
|
+
"@tensor-cad/engine": "0.1.0",
|
|
29
|
+
"ws": "^8.21.3",
|
|
30
|
+
"zod": "^4.2.0"
|
|
31
|
+
},
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/Filip-Pajalic/TensorCAD.git"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/prompts.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompts.
|
|
3
|
+
*
|
|
4
|
+
* Four workflows worth having a slash command for. In Claude Code these show
|
|
5
|
+
* up as `/mcp__tensorcad__design_model` and friends.
|
|
6
|
+
*
|
|
7
|
+
* MCP prompt arguments are strings on the wire, so the schemas take strings and
|
|
8
|
+
* the text says what a good value looks like.
|
|
9
|
+
*/
|
|
10
|
+
import type { McpServer } from "@modelcontextprotocol/server";
|
|
11
|
+
export declare function registerPrompts(server: McpServer): void;
|
|
12
|
+
export declare const PROMPT_NAMES: readonly ["design_model", "review_design", "scale_design", "explain_costs"];
|
package/resources.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resources.
|
|
3
|
+
*
|
|
4
|
+
* Almost no design tool exposes its document as an MCP resource, which is a
|
|
5
|
+
* gap worth closing: resources are `@`-mentionable in Claude Code, they are
|
|
6
|
+
* cache friendly, and they let a client read a design without spending a tool
|
|
7
|
+
* call on it.
|
|
8
|
+
*/
|
|
9
|
+
import { McpServer } from "@modelcontextprotocol/server";
|
|
10
|
+
import type { DocumentStore } from "./store/types.js";
|
|
11
|
+
export declare function registerResources(server: McpServer, store: DocumentStore): void;
|
package/schemas.d.ts
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The wire contract.
|
|
3
|
+
*
|
|
4
|
+
* Every tool declares both an `inputSchema` and an `outputSchema`, so a client
|
|
5
|
+
* can validate what it gets back and a model can see the shape of an answer
|
|
6
|
+
* before it asks for one.
|
|
7
|
+
*/
|
|
8
|
+
import * as z from "zod";
|
|
9
|
+
export declare const DESIGN_ID: z.ZodString;
|
|
10
|
+
export declare const Severity: z.ZodEnum<{
|
|
11
|
+
error: "error";
|
|
12
|
+
warning: "warning";
|
|
13
|
+
info: "info";
|
|
14
|
+
}>;
|
|
15
|
+
export declare const Finding: z.ZodObject<{
|
|
16
|
+
rule: z.ZodString;
|
|
17
|
+
severity: z.ZodEnum<{
|
|
18
|
+
error: "error";
|
|
19
|
+
warning: "warning";
|
|
20
|
+
info: "info";
|
|
21
|
+
}>;
|
|
22
|
+
path: z.ZodOptional<z.ZodString>;
|
|
23
|
+
port: z.ZodOptional<z.ZodString>;
|
|
24
|
+
message: z.ZodString;
|
|
25
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const Counts: z.ZodObject<{
|
|
28
|
+
error: z.ZodNumber;
|
|
29
|
+
warning: z.ZodNumber;
|
|
30
|
+
info: z.ZodNumber;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export declare const ValidationSummary: z.ZodObject<{
|
|
33
|
+
ok: z.ZodBoolean;
|
|
34
|
+
counts: z.ZodObject<{
|
|
35
|
+
error: z.ZodNumber;
|
|
36
|
+
warning: z.ZodNumber;
|
|
37
|
+
info: z.ZodNumber;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
top_findings: z.ZodArray<z.ZodObject<{
|
|
40
|
+
rule: z.ZodString;
|
|
41
|
+
severity: z.ZodEnum<{
|
|
42
|
+
error: "error";
|
|
43
|
+
warning: "warning";
|
|
44
|
+
info: "info";
|
|
45
|
+
}>;
|
|
46
|
+
path: z.ZodOptional<z.ZodString>;
|
|
47
|
+
port: z.ZodOptional<z.ZodString>;
|
|
48
|
+
message: z.ZodString;
|
|
49
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export declare const DesignSummary: z.ZodObject<{
|
|
53
|
+
design_id: z.ZodString;
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
revision: z.ZodNumber;
|
|
56
|
+
path: z.ZodOptional<z.ZodString>;
|
|
57
|
+
source: z.ZodEnum<{
|
|
58
|
+
file: "file";
|
|
59
|
+
preset: "preset";
|
|
60
|
+
empty: "empty";
|
|
61
|
+
}>;
|
|
62
|
+
dirty: z.ZodBoolean;
|
|
63
|
+
created_at: z.ZodString;
|
|
64
|
+
updated_at: z.ZodString;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export declare const OutlineSymbol: z.ZodObject<{
|
|
67
|
+
name: z.ZodString;
|
|
68
|
+
kind: z.ZodEnum<{
|
|
69
|
+
runtime: "runtime";
|
|
70
|
+
design: "design";
|
|
71
|
+
}>;
|
|
72
|
+
value: z.ZodString;
|
|
73
|
+
resolved: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
doc: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export declare const OutlineBlock: z.ZodObject<{
|
|
77
|
+
path: z.ZodString;
|
|
78
|
+
type: z.ZodString;
|
|
79
|
+
kind: z.ZodString;
|
|
80
|
+
depth: z.ZodNumber;
|
|
81
|
+
label: z.ZodOptional<z.ZodString>;
|
|
82
|
+
params: z.ZodNumber;
|
|
83
|
+
repeat: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
export declare const OutlineEdge: z.ZodObject<{
|
|
86
|
+
graph: z.ZodString;
|
|
87
|
+
from: z.ZodString;
|
|
88
|
+
to: z.ZodString;
|
|
89
|
+
shape: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
export declare const Outline: z.ZodObject<{
|
|
92
|
+
name: z.ZodString;
|
|
93
|
+
family: z.ZodOptional<z.ZodString>;
|
|
94
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
95
|
+
symbols: z.ZodArray<z.ZodObject<{
|
|
96
|
+
name: z.ZodString;
|
|
97
|
+
kind: z.ZodEnum<{
|
|
98
|
+
runtime: "runtime";
|
|
99
|
+
design: "design";
|
|
100
|
+
}>;
|
|
101
|
+
value: z.ZodString;
|
|
102
|
+
resolved: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
doc: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$strip>>;
|
|
105
|
+
blocks: z.ZodArray<z.ZodObject<{
|
|
106
|
+
path: z.ZodString;
|
|
107
|
+
type: z.ZodString;
|
|
108
|
+
kind: z.ZodString;
|
|
109
|
+
depth: z.ZodNumber;
|
|
110
|
+
label: z.ZodOptional<z.ZodString>;
|
|
111
|
+
params: z.ZodNumber;
|
|
112
|
+
repeat: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
edges: z.ZodArray<z.ZodObject<{
|
|
115
|
+
graph: z.ZodString;
|
|
116
|
+
from: z.ZodString;
|
|
117
|
+
to: z.ZodString;
|
|
118
|
+
shape: z.ZodOptional<z.ZodString>;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
params_total: z.ZodNumber;
|
|
121
|
+
params_active: z.ZodNumber;
|
|
122
|
+
issues: z.ZodNumber;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
export declare const BlockPort: z.ZodObject<{
|
|
125
|
+
name: z.ZodString;
|
|
126
|
+
pattern: z.ZodString;
|
|
127
|
+
shape: z.ZodOptional<z.ZodString>;
|
|
128
|
+
dtype: z.ZodOptional<z.ZodString>;
|
|
129
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
130
|
+
connected_to: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
/** The knobs `tensorcad_analyze` and `tensorcad_validate` share. */
|
|
133
|
+
export declare const analysisOptionsShape: {
|
|
134
|
+
T: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
B: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
dtype: z.ZodOptional<z.ZodEnum<{
|
|
137
|
+
fp32: "fp32";
|
|
138
|
+
bf16: "bf16";
|
|
139
|
+
fp16: "fp16";
|
|
140
|
+
fp8: "fp8";
|
|
141
|
+
}>>;
|
|
142
|
+
hardware: z.ZodOptional<z.ZodString>;
|
|
143
|
+
gpus: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
tokens: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
optimizer: z.ZodOptional<z.ZodEnum<{
|
|
146
|
+
adamw: "adamw";
|
|
147
|
+
adamw8bit: "adamw8bit";
|
|
148
|
+
muon: "muon";
|
|
149
|
+
sgd_momentum: "sgd_momentum";
|
|
150
|
+
sgd: "sgd";
|
|
151
|
+
bf16_adam: "bf16_adam";
|
|
152
|
+
}>>;
|
|
153
|
+
recompute: z.ZodOptional<z.ZodEnum<{
|
|
154
|
+
none: "none";
|
|
155
|
+
selective: "selective";
|
|
156
|
+
full: "full";
|
|
157
|
+
}>>;
|
|
158
|
+
zero: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
tp: z.ZodOptional<z.ZodNumber>;
|
|
160
|
+
dp: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
pp: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
ep: z.ZodOptional<z.ZodNumber>;
|
|
163
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
mfu: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
};
|
|
166
|
+
export declare const Op: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
167
|
+
op: z.ZodLiteral<"add_node">;
|
|
168
|
+
parent: z.ZodOptional<z.ZodString>;
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
type: z.ZodString;
|
|
171
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
172
|
+
label: z.ZodOptional<z.ZodString>;
|
|
173
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
174
|
+
op: z.ZodLiteral<"remove_node">;
|
|
175
|
+
path: z.ZodString;
|
|
176
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
177
|
+
op: z.ZodLiteral<"set_param">;
|
|
178
|
+
path: z.ZodString;
|
|
179
|
+
key: z.ZodString;
|
|
180
|
+
value: z.ZodAny;
|
|
181
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
182
|
+
op: z.ZodLiteral<"connect">;
|
|
183
|
+
graph: z.ZodOptional<z.ZodString>;
|
|
184
|
+
from: z.ZodString;
|
|
185
|
+
to: z.ZodString;
|
|
186
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
187
|
+
op: z.ZodLiteral<"disconnect">;
|
|
188
|
+
graph: z.ZodOptional<z.ZodString>;
|
|
189
|
+
from: z.ZodString;
|
|
190
|
+
to: z.ZodString;
|
|
191
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
192
|
+
op: z.ZodLiteral<"set_symbol">;
|
|
193
|
+
name: z.ZodString;
|
|
194
|
+
value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodNull]>;
|
|
195
|
+
doc: z.ZodOptional<z.ZodString>;
|
|
196
|
+
runtime: z.ZodOptional<z.ZodBoolean>;
|
|
197
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
198
|
+
op: z.ZodLiteral<"rename">;
|
|
199
|
+
path: z.ZodString;
|
|
200
|
+
id: z.ZodString;
|
|
201
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
202
|
+
op: z.ZodLiteral<"set_label">;
|
|
203
|
+
path: z.ZodString;
|
|
204
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
205
|
+
}, z.core.$strip>], "op">;
|
|
206
|
+
export declare const AnalysisOutput: z.ZodObject<{
|
|
207
|
+
design_id: z.ZodString;
|
|
208
|
+
revision: z.ZodNumber;
|
|
209
|
+
name: z.ZodString;
|
|
210
|
+
options: z.ZodObject<{
|
|
211
|
+
T: z.ZodNumber;
|
|
212
|
+
B: z.ZodNumber;
|
|
213
|
+
dtype: z.ZodString;
|
|
214
|
+
hardware: z.ZodString;
|
|
215
|
+
gpus: z.ZodNumber;
|
|
216
|
+
parallel: z.ZodObject<{
|
|
217
|
+
dp: z.ZodNumber;
|
|
218
|
+
tp: z.ZodNumber;
|
|
219
|
+
pp: z.ZodNumber;
|
|
220
|
+
ep: z.ZodNumber;
|
|
221
|
+
zero: z.ZodNumber;
|
|
222
|
+
sequenceParallel: z.ZodBoolean;
|
|
223
|
+
}, z.core.$strip>;
|
|
224
|
+
optimizer: z.ZodString;
|
|
225
|
+
recompute: z.ZodString;
|
|
226
|
+
tokens: z.ZodNumber;
|
|
227
|
+
tokens_were_defaulted: z.ZodBoolean;
|
|
228
|
+
mfu: z.ZodNumber;
|
|
229
|
+
concurrency: z.ZodNumber;
|
|
230
|
+
}, z.core.$strip>;
|
|
231
|
+
params: z.ZodObject<{
|
|
232
|
+
total: z.ZodNumber;
|
|
233
|
+
active: z.ZodNumber;
|
|
234
|
+
embedding: z.ZodNumber;
|
|
235
|
+
head: z.ZodNumber;
|
|
236
|
+
non_embedding: z.ZodNumber;
|
|
237
|
+
non_embedding_active: z.ZodNumber;
|
|
238
|
+
by_category: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
239
|
+
by_type: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
240
|
+
}, z.core.$strip>;
|
|
241
|
+
flops: z.ZodObject<{
|
|
242
|
+
fwd_dense: z.ZodNullable<z.ZodNumber>;
|
|
243
|
+
fwd_attention: z.ZodNullable<z.ZodNumber>;
|
|
244
|
+
fwd_total: z.ZodNullable<z.ZodNumber>;
|
|
245
|
+
elementwise: z.ZodNullable<z.ZodNumber>;
|
|
246
|
+
train_per_token: z.ZodNullable<z.ZodNumber>;
|
|
247
|
+
attention_share: z.ZodNullable<z.ZodNumber>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
kv: z.ZodObject<{
|
|
250
|
+
bytes_per_token: z.ZodNullable<z.ZodNumber>;
|
|
251
|
+
bytes_per_sequence: z.ZodNullable<z.ZodNumber>;
|
|
252
|
+
bytes_per_token_decompressed: z.ZodNullable<z.ZodNumber>;
|
|
253
|
+
}, z.core.$strip>;
|
|
254
|
+
memory: z.ZodObject<{
|
|
255
|
+
optimizer_label: z.ZodString;
|
|
256
|
+
train_weights: z.ZodNullable<z.ZodNumber>;
|
|
257
|
+
train_grads: z.ZodNullable<z.ZodNumber>;
|
|
258
|
+
train_optimizer: z.ZodNullable<z.ZodNumber>;
|
|
259
|
+
train_activations: z.ZodNullable<z.ZodNumber>;
|
|
260
|
+
train_per_gpu: z.ZodNullable<z.ZodNumber>;
|
|
261
|
+
train_total: z.ZodNullable<z.ZodNumber>;
|
|
262
|
+
infer_weights: z.ZodNullable<z.ZodNumber>;
|
|
263
|
+
infer_kv: z.ZodNullable<z.ZodNumber>;
|
|
264
|
+
infer_total: z.ZodNullable<z.ZodNumber>;
|
|
265
|
+
device_memory: z.ZodNullable<z.ZodNumber>;
|
|
266
|
+
notes: z.ZodArray<z.ZodString>;
|
|
267
|
+
}, z.core.$strip>;
|
|
268
|
+
throughput: z.ZodObject<{
|
|
269
|
+
decode_tokens_per_second: z.ZodNullable<z.ZodNumber>;
|
|
270
|
+
decode_weight_bytes: z.ZodNullable<z.ZodNumber>;
|
|
271
|
+
resident_weight_bytes: z.ZodNullable<z.ZodNumber>;
|
|
272
|
+
prefill_seconds: z.ZodNullable<z.ZodNumber>;
|
|
273
|
+
memory_bound: z.ZodBoolean;
|
|
274
|
+
notes: z.ZodArray<z.ZodString>;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
cost: z.ZodObject<{
|
|
277
|
+
total_flops: z.ZodNullable<z.ZodNumber>;
|
|
278
|
+
gpu_hours: z.ZodNullable<z.ZodNumber>;
|
|
279
|
+
wall_clock_hours: z.ZodNullable<z.ZodNumber>;
|
|
280
|
+
dollars: z.ZodNullable<z.ZodNumber>;
|
|
281
|
+
tokens: z.ZodNumber;
|
|
282
|
+
}, z.core.$strip>;
|
|
283
|
+
chinchilla: z.ZodObject<{
|
|
284
|
+
optimal_tokens: z.ZodNullable<z.ZodNumber>;
|
|
285
|
+
tokens_per_param: z.ZodNullable<z.ZodNumber>;
|
|
286
|
+
over_training_ratio: z.ZodNullable<z.ZodNumber>;
|
|
287
|
+
verdict: z.ZodString;
|
|
288
|
+
}, z.core.$strip>;
|
|
289
|
+
errors: z.ZodArray<z.ZodString>;
|
|
290
|
+
}, z.core.$strip>;
|
|
291
|
+
export type OpInput = z.infer<typeof Op>;
|
package/serve.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Starting the server, as a function rather than as a side effect.
|
|
3
|
+
*
|
|
4
|
+
* It used to be a bare `if (import.meta.main)` at the bottom of `index.ts`,
|
|
5
|
+
* which made that module two things: a library other code imports and a program
|
|
6
|
+
* that starts a server. That works under Bun and does not survive a bundler —
|
|
7
|
+
* `import.meta.main` compiles to a CommonJS check that is not defined in an ESM
|
|
8
|
+
* output, so the bundled server crashed before its first line ran.
|
|
9
|
+
*/
|
|
10
|
+
/** Serve on stdio until the transport closes. */
|
|
11
|
+
export declare function serve(root?: string): Promise<void>;
|