@codefionn/llmleaf-client 0.1.2

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.
@@ -0,0 +1,301 @@
1
+ import type { Role, FinishReason, BatchStatus } from "./enums.js";
2
+ export type { Role, FinishReason, BatchStatus };
3
+ export interface Usage {
4
+ promptTokens: number;
5
+ completionTokens: number;
6
+ totalTokens: number;
7
+ /** llmleaf addition; absent when the model has no known price. */
8
+ costUsd?: number;
9
+ }
10
+ export interface TextPart {
11
+ type: "text";
12
+ text: string;
13
+ }
14
+ export interface ImageUrlPart {
15
+ type: "image_url";
16
+ imageUrl: {
17
+ url: string;
18
+ /** "auto" | "low" | "high" */
19
+ detail?: string;
20
+ };
21
+ }
22
+ export type ContentPart = TextPart | ImageUrlPart;
23
+ /** Wire `content` is either a plain string or an array of content parts. */
24
+ export type MessageContent = string | ContentPart[];
25
+ export interface FunctionCall {
26
+ name: string;
27
+ /** JSON-encoded arguments string (OpenAI shape). */
28
+ arguments: string;
29
+ }
30
+ export interface ToolCall {
31
+ id: string;
32
+ /** always "function" today */
33
+ type: string;
34
+ function: FunctionCall;
35
+ }
36
+ export interface ChatMessage {
37
+ role: Role;
38
+ content?: MessageContent;
39
+ name?: string;
40
+ toolCalls?: ToolCall[];
41
+ /** set when role == TOOL */
42
+ toolCallId?: string;
43
+ }
44
+ export interface FunctionDef {
45
+ name: string;
46
+ description?: string;
47
+ /** raw JSON Schema object, as a JSON string. */
48
+ parameters?: string;
49
+ }
50
+ export interface ToolDef {
51
+ /** "function" */
52
+ type: string;
53
+ function: FunctionDef;
54
+ }
55
+ /** "auto" | "none" | "required", or a named-function object. */
56
+ export type ToolChoice = string | {
57
+ type: "function";
58
+ function: {
59
+ name: string;
60
+ };
61
+ };
62
+ export interface ResponseFormat {
63
+ /** "text" | "json_object" | "json_schema" */
64
+ type: string;
65
+ /** raw JSON object as a JSON string when type == "json_schema". */
66
+ jsonSchema?: string;
67
+ }
68
+ export interface ChatRequest {
69
+ model: string;
70
+ messages: ChatMessage[];
71
+ stream?: boolean;
72
+ temperature?: number;
73
+ topP?: number;
74
+ /** legacy name */
75
+ maxTokens?: number;
76
+ /** modern name (takes precedence) */
77
+ maxCompletionTokens?: number;
78
+ stop?: string[];
79
+ n?: number;
80
+ seed?: number;
81
+ frequencyPenalty?: number;
82
+ presencePenalty?: number;
83
+ tools?: ToolDef[];
84
+ toolChoice?: ToolChoice;
85
+ responseFormat?: ResponseFormat;
86
+ /** "low" | "medium" | "high" */
87
+ reasoningEffort?: string;
88
+ /** dialect-specific passthrough, raw JSON object as a JSON string, merged at the top level. */
89
+ extra?: string;
90
+ }
91
+ export interface Choice {
92
+ index: number;
93
+ message: ChatMessage;
94
+ finishReason?: FinishReason;
95
+ }
96
+ export interface ChatResponse {
97
+ id: string;
98
+ /** "chat.completion" */
99
+ object: string;
100
+ /** unix seconds */
101
+ created: number;
102
+ model: string;
103
+ choices: Choice[];
104
+ usage?: Usage;
105
+ }
106
+ export interface FunctionCallDelta {
107
+ name?: string;
108
+ arguments?: string;
109
+ }
110
+ export interface ToolCallDelta {
111
+ index: number;
112
+ id?: string;
113
+ type?: string;
114
+ function?: FunctionCallDelta;
115
+ }
116
+ export interface Delta {
117
+ /** first chunk only */
118
+ role?: Role;
119
+ /** incremental text */
120
+ content?: string;
121
+ toolCalls?: ToolCallDelta[];
122
+ }
123
+ export interface ChunkChoice {
124
+ index: number;
125
+ delta: Delta;
126
+ finishReason?: FinishReason;
127
+ }
128
+ export interface ChatCompletionChunk {
129
+ id: string;
130
+ /** "chat.completion.chunk" */
131
+ object: string;
132
+ created: number;
133
+ model: string;
134
+ choices: ChunkChoice[];
135
+ /** terminal chunk only */
136
+ usage?: Usage;
137
+ }
138
+ export interface EmbeddingRequest {
139
+ model: string;
140
+ /** wire accepts string or array of strings. */
141
+ input: string[];
142
+ dimensions?: number;
143
+ /** "float" | "base64" */
144
+ encodingFormat?: string;
145
+ /** raw JSON object passthrough as a JSON string. */
146
+ extra?: string;
147
+ }
148
+ export interface Embedding {
149
+ /** "embedding" */
150
+ object: string;
151
+ index: number;
152
+ /** Always decoded to floats, even when encoding_format == "base64". */
153
+ embedding: number[];
154
+ }
155
+ export interface EmbeddingResponse {
156
+ /** "list" */
157
+ object: string;
158
+ data: Embedding[];
159
+ model: string;
160
+ usage?: Usage;
161
+ }
162
+ export interface SpeechRequest {
163
+ model: string;
164
+ input: string;
165
+ voice: string;
166
+ /** mp3|opus|aac|flac|wav|pcm */
167
+ responseFormat?: string;
168
+ speed?: number;
169
+ /** raw JSON object passthrough as a JSON string. */
170
+ extra?: string;
171
+ }
172
+ /** Raw audio bytes plus the Content-Type the server reported. */
173
+ export interface SpeechResult {
174
+ bytes: Uint8Array;
175
+ contentType: string;
176
+ }
177
+ export interface Voice {
178
+ /** value to put in SpeechRequest.voice */
179
+ id: string;
180
+ name?: string;
181
+ /** BCP-47 tags */
182
+ languages: string[];
183
+ }
184
+ export interface VoicesResponse {
185
+ model: string;
186
+ voices: Voice[];
187
+ }
188
+ export interface TranscriptionRequest {
189
+ model: string;
190
+ /** ISO-639-1 hint */
191
+ language?: string;
192
+ /** decoding bias */
193
+ prompt?: string;
194
+ /** json|text|verbose_json|srt|vtt */
195
+ responseFormat?: string;
196
+ temperature?: number;
197
+ }
198
+ export interface TranscriptionResponse {
199
+ text: string;
200
+ /** "transcribe" (verbose_json) */
201
+ task?: string;
202
+ language?: string;
203
+ duration?: number;
204
+ usage?: Usage;
205
+ }
206
+ export interface Architecture {
207
+ inputModalities: string[];
208
+ outputModalities: string[];
209
+ /** "text->text" | "text->audio" | ... */
210
+ modality?: string;
211
+ tokenizer: string;
212
+ instructType?: string;
213
+ }
214
+ export interface Pricing {
215
+ /** USD per token, decimal string */
216
+ prompt: string;
217
+ completion: string;
218
+ }
219
+ export interface TopProvider {
220
+ contextLength?: number;
221
+ maxCompletionTokens?: number;
222
+ isModerated: boolean;
223
+ /** llmleaf extension */
224
+ maxThinkingTokens?: number;
225
+ }
226
+ /** Admin-only fallback-chain entry (present only with a valid admin token). */
227
+ export interface ModelEndpoint {
228
+ provider: string;
229
+ model: string;
230
+ down: boolean;
231
+ /** "route" | "prefix" */
232
+ source: string;
233
+ }
234
+ export interface ModelEntry {
235
+ id: string;
236
+ canonicalSlug: string;
237
+ name: string;
238
+ created: number;
239
+ description: string;
240
+ contextLength?: number;
241
+ architecture?: Architecture;
242
+ pricing?: Pricing;
243
+ topProvider?: TopProvider;
244
+ supportedParameters: string[];
245
+ unsupportedParameters: string[];
246
+ /** raw JSON object as a JSON string. */
247
+ defaultParameters?: string;
248
+ /** admin-only */
249
+ endpoints: ModelEndpoint[];
250
+ }
251
+ export interface ListModelsResponse {
252
+ data: ModelEntry[];
253
+ }
254
+ /** Filter for {@link "./client".LlmleafClient.listModels}. */
255
+ export type ModelType = "all" | "llm" | "tts" | "stt" | "embedding";
256
+ export interface ListModelsOptions {
257
+ type?: ModelType;
258
+ /** substring search */
259
+ search?: string;
260
+ /** when true, send the admin token so per-model `endpoints` are included. */
261
+ admin?: boolean;
262
+ }
263
+ export interface BatchRequestItem {
264
+ customId: string;
265
+ body: ChatRequest;
266
+ }
267
+ export interface BatchCreateRequest {
268
+ requests: BatchRequestItem[];
269
+ }
270
+ export interface BatchCounts {
271
+ total: number;
272
+ processing: number;
273
+ succeeded: number;
274
+ errored: number;
275
+ canceled: number;
276
+ expired: number;
277
+ }
278
+ export interface BatchHandle {
279
+ id: string;
280
+ status: BatchStatus;
281
+ counts?: BatchCounts;
282
+ createdAt?: number;
283
+ expiresAt?: number;
284
+ endedAt?: number;
285
+ /** e.g. "/v1/chat/completions" */
286
+ endpoint?: string;
287
+ }
288
+ export interface BatchResponse {
289
+ statusCode: number;
290
+ body: ChatResponse;
291
+ }
292
+ export interface BatchError {
293
+ code: string;
294
+ message: string;
295
+ }
296
+ export interface BatchResultLine {
297
+ customId: string;
298
+ response?: BatchResponse;
299
+ error?: BatchError;
300
+ }
301
+ //# sourceMappingURL=types.d.ts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;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB"}
package/dist/types.js ADDED
@@ -0,0 +1,14 @@
1
+ // Public, hand-written TypeScript surface mirroring proto/llmleaf/v1/llmleaf.proto.
2
+ //
3
+ // Why interfaces and not the generated protobuf-es classes directly? protobuf-es's
4
+ // own JSON codec emits camelCase keys and STRING enum NAMES (e.g. "ASSISTANT"), which
5
+ // do NOT match the OpenAI/OpenRouter wire (snake_case keys + lowercase tokens like
6
+ // "assistant"), and it has no notion of the "free-form JSON carried as a raw string"
7
+ // or "content is string-or-array" conventions in SPEC.md. So these plain interfaces
8
+ // are the ergonomic public model; src/wire.ts maps them to/from the actual wire JSON.
9
+ //
10
+ // The generated descriptors/enums remain the committed codegen artifact (src/gen) and
11
+ // are the single source of truth these shapes track. The three closed-set enums are
12
+ // re-used straight from the generated file via src/enums.ts.
13
+ export {};
14
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,EAAE;AACF,mFAAmF;AACnF,sFAAsF;AACtF,mFAAmF;AACnF,qFAAqF;AACrF,oFAAoF;AACpF,sFAAsF;AACtF,EAAE;AACF,sFAAsF;AACtF,oFAAoF;AACpF,6DAA6D"}
package/dist/wire.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ import type { ChatRequest, ChatMessage, ChatResponse, ChatCompletionChunk, Usage, EmbeddingRequest, EmbeddingResponse, SpeechRequest, VoicesResponse, TranscriptionResponse, ListModelsResponse, BatchCreateRequest, BatchHandle, BatchResultLine } from "./types.js";
2
+ type Json = Record<string, unknown>;
3
+ /** Build the chat request body. `forceStream` overrides `stream` for the streaming call. */
4
+ export declare function encodeChatRequest(req: ChatRequest, forceStream?: boolean): Json;
5
+ export declare function decodeUsage(v: unknown): Usage | undefined;
6
+ export declare function decodeMessage(v: unknown): ChatMessage;
7
+ export declare function decodeChatResponse(v: unknown): ChatResponse;
8
+ export declare function decodeChatCompletionChunk(v: unknown): ChatCompletionChunk;
9
+ export declare function encodeEmbeddingRequest(req: EmbeddingRequest): Json;
10
+ export declare function decodeEmbeddingResponse(v: unknown): EmbeddingResponse;
11
+ export declare function encodeSpeechRequest(req: SpeechRequest): Json;
12
+ export declare function decodeVoicesResponse(v: unknown): VoicesResponse;
13
+ export declare function decodeTranscriptionResponse(v: unknown): TranscriptionResponse;
14
+ export declare function decodeListModelsResponse(v: unknown): ListModelsResponse;
15
+ export declare function encodeBatchCreateRequest(req: BatchCreateRequest): Json;
16
+ export declare function decodeBatchHandle(v: unknown): BatchHandle;
17
+ export declare function decodeBatchResultLine(v: unknown): BatchResultLine;
18
+ export {};
19
+ //# sourceMappingURL=wire.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../src/wire.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EAOX,YAAY,EAEZ,mBAAmB,EAInB,KAAK,EACL,gBAAgB,EAChB,iBAAiB,EAEjB,aAAa,EACb,cAAc,EAEd,qBAAqB,EACrB,kBAAkB,EAMlB,kBAAkB,EAClB,WAAW,EAEX,eAAe,EAGhB,MAAM,YAAY,CAAC;AAGpB,KAAK,IA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