@cldmv/llm-translator 0.11.0 → 0.13.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 +8 -9
- package/dist/api/convert/anthropic/messages/to/openai/responses/request.mjs +2 -0
- package/dist/api/convert/openai/chat/to/openai/responses/request.mjs +2 -0
- package/dist/api/convert/openai/chat/to/openai/responses/response.mjs +2 -0
- package/dist/api/convert/openai/chat/to/openai/responses/stream.mjs +2 -0
- package/dist/api/convert/openai/responses/to/anthropic/messages/response.mjs +2 -0
- package/dist/api/convert/openai/responses/to/anthropic/messages/stream.mjs +2 -0
- package/dist/api/convert/openai/responses/to/openai/chat/request.mjs +6 -0
- package/dist/api/convert/openai/responses/to/openai/chat/response.mjs +2 -0
- package/dist/api/convert/openai/responses/to/openai/chat/stream.mjs +2 -0
- package/dist/api/detect.mjs +1 -1
- package/dist/api/driver/anthropic/info.mjs +1 -1
- package/dist/api/driver/azure/info.mjs +1 -1
- package/dist/api/driver/compatible/info.mjs +1 -1
- package/dist/api/driver/deepseek/info.mjs +1 -1
- package/dist/api/driver/llamacpp/info.mjs +1 -1
- package/dist/api/driver/lmstudio/info.mjs +1 -1
- package/dist/api/driver/localai/info.mjs +1 -1
- package/dist/api/driver/mistral/info.mjs +1 -1
- package/dist/api/driver/ollama/info.mjs +1 -1
- package/dist/api/driver/ollama/request.mjs +1 -1
- package/dist/api/driver/openai/info.mjs +1 -1
- package/dist/api/driver/openrouter/info.mjs +1 -1
- package/dist/api/driver/sglang/info.mjs +1 -1
- package/dist/api/driver/tgi/info.mjs +1 -1
- package/dist/api/driver/vllm/info.mjs +1 -1
- package/dist/api/request.mjs +2 -2
- package/dist/api/response.mjs +1 -1
- package/dist/api/route.mjs +1 -1
- package/dist/api/send.mjs +1 -1
- package/dist/api/server/plugin.mjs +1 -1
- package/dist/api/server/start.mjs +1 -1
- package/dist/api/status.mjs +1 -1
- package/dist/api/stream.mjs +1 -1
- package/dist/api/token/count.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/capture.mjs +1 -1
- package/dist/lib/cli.mjs +16 -7
- package/dist/lib/config.mjs +1 -1
- package/dist/lib/estimate.mjs +1 -1
- package/dist/lib/guard.mjs +2 -0
- package/dist/lib/http.mjs +1 -1
- package/dist/lib/metrics.mjs +4 -0
- package/dist/lib/presets.mjs +1 -1
- package/dist/lib/protocol.mjs +2 -0
- package/dist/lib/responses-upstream.mjs +13 -0
- package/dist/lib/responses.mjs +2 -0
- package/dist/lib/route.mjs +1 -1
- package/dist/lib/routes.mjs +1 -1
- package/dist/lib/settings.mjs +1 -1
- package/dist/lib/vllm.mjs +2 -2
- package/package.json +1 -1
- package/types/src/api/convert/anthropic/messages/to/openai/responses/request.d.mts +16 -0
- package/types/src/api/convert/openai/chat/to/openai/responses/request.d.mts +12 -0
- package/types/src/api/convert/openai/chat/to/openai/responses/response.d.mts +14 -0
- package/types/src/api/convert/openai/chat/to/openai/responses/stream.d.mts +18 -0
- package/types/src/api/convert/openai/responses/to/anthropic/messages/response.d.mts +8 -0
- package/types/src/api/convert/openai/responses/to/anthropic/messages/stream.d.mts +8 -0
- package/types/src/api/convert/openai/responses/to/openai/chat/request.d.mts +17 -0
- package/types/src/api/convert/openai/responses/to/openai/chat/response.d.mts +8 -0
- package/types/src/api/convert/openai/responses/to/openai/chat/stream.d.mts +10 -0
- package/types/src/api/driver/anthropic/info.d.mts +2 -1
- package/types/src/api/driver/azure/info.d.mts +2 -1
- package/types/src/api/driver/compatible/info.d.mts +2 -1
- package/types/src/api/driver/deepseek/info.d.mts +2 -1
- package/types/src/api/driver/fireworks/info.d.mts +2 -1
- package/types/src/api/driver/gemini/info.d.mts +2 -1
- package/types/src/api/driver/groq/info.d.mts +2 -1
- package/types/src/api/driver/llamacpp/info.d.mts +2 -1
- package/types/src/api/driver/lmstudio/info.d.mts +2 -1
- package/types/src/api/driver/localai/info.d.mts +2 -1
- package/types/src/api/driver/mistral/info.d.mts +2 -1
- package/types/src/api/driver/ollama/info.d.mts +2 -1
- package/types/src/api/driver/ollama/request.d.mts +1 -1
- package/types/src/api/driver/openai/info.d.mts +2 -1
- package/types/src/api/driver/openrouter/info.d.mts +2 -1
- package/types/src/api/driver/sglang/info.d.mts +2 -1
- package/types/src/api/driver/tgi/info.d.mts +2 -1
- package/types/src/api/driver/together/info.d.mts +2 -1
- package/types/src/api/driver/vllm/info.d.mts +2 -1
- package/types/src/api/driver/xai/info.d.mts +2 -1
- package/types/src/api/request.d.mts +3 -2
- package/types/src/api/route.d.mts +2 -2
- package/types/src/api/send.d.mts +1 -1
- package/types/src/api/server/plugin.d.mts +2 -2
- package/types/src/api/server/start.d.mts +1 -1
- package/types/src/api/status.d.mts +1 -1
- package/types/src/lib/config.d.mts +4 -3
- package/types/src/lib/estimate.d.mts +1 -1
- package/types/src/lib/guard.d.mts +25 -0
- package/types/src/lib/http.d.mts +4 -3
- package/types/src/lib/metrics.d.mts +58 -0
- package/types/src/lib/presets.d.mts +2 -1
- package/types/src/lib/protocol.d.mts +84 -0
- package/types/src/lib/responses-upstream.d.mts +58 -0
- package/types/src/lib/responses.d.mts +72 -0
- package/types/src/lib/route.d.mts +7 -3
- package/types/src/lib/routes.d.mts +3 -2
- package/types/src/lib/settings.d.mts +11 -6
- package/types/src/lib/vllm.d.mts +4 -4
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Responses style id: `resp_`, `msg_`, `fc_` or `rs_` and 24 hex digits.
|
|
3
|
+
* @param {"resp" | "msg" | "fc" | "rs"} prefix - Id family.
|
|
4
|
+
* @returns {string} The id.
|
|
5
|
+
*/
|
|
6
|
+
export function itemId(prefix: "resp" | "msg" | "fc" | "rs"): string;
|
|
7
|
+
/**
|
|
8
|
+
* Pack the `reasoning_details` of a reply into the `encrypted_content` of a reasoning item, so the client sends them back with the next turn.
|
|
9
|
+
* @param {unknown} details - `reasoning_details` list.
|
|
10
|
+
* @returns {string | undefined} The carrier string, or undefined when there is nothing to carry.
|
|
11
|
+
*/
|
|
12
|
+
export function pack(details: unknown): string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Read back what {@link pack} wrote. Anything else (another producer's data, a malformed or oversized value) gives null.
|
|
15
|
+
* @param {unknown} value - `encrypted_content` of a reasoning item the client sent.
|
|
16
|
+
* @returns {object[] | null} The `reasoning_details` items, or null.
|
|
17
|
+
*/
|
|
18
|
+
export function unpack(value: unknown): object[] | null;
|
|
19
|
+
/**
|
|
20
|
+
* Responses usage for a Chat Completions usage object.
|
|
21
|
+
* @param {any} usage - Chat `usage` (may be absent).
|
|
22
|
+
* @returns {{input_tokens: number, input_tokens_details: {cached_tokens: number}, output_tokens: number, output_tokens_details: {reasoning_tokens: number}, total_tokens: number} | null} Usage, or null when the upstream sent none.
|
|
23
|
+
*/
|
|
24
|
+
export function usageOf(usage: any): {
|
|
25
|
+
input_tokens: number;
|
|
26
|
+
input_tokens_details: {
|
|
27
|
+
cached_tokens: number;
|
|
28
|
+
};
|
|
29
|
+
output_tokens: number;
|
|
30
|
+
output_tokens_details: {
|
|
31
|
+
reasoning_tokens: number;
|
|
32
|
+
};
|
|
33
|
+
total_tokens: number;
|
|
34
|
+
} | null;
|
|
35
|
+
/**
|
|
36
|
+
* Status and `incomplete_details` for a Chat Completions `finish_reason`: a length stop and a content filter end the response early.
|
|
37
|
+
* @param {string | null | undefined} finish - `finish_reason`.
|
|
38
|
+
* @returns {{status: "completed"} | {status: "incomplete", incomplete_details: {reason: string}}} Terminal status.
|
|
39
|
+
*/
|
|
40
|
+
export function endOf(finish: string | null | undefined): {
|
|
41
|
+
status: "completed";
|
|
42
|
+
} | {
|
|
43
|
+
status: "incomplete";
|
|
44
|
+
incomplete_details: {
|
|
45
|
+
reason: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The response object around a list of output items, echoing the request parameters the way the API does.
|
|
50
|
+
* @param {any} state - State from the request converter (`model`, `echo`).
|
|
51
|
+
* @param {{id: string, created: number, status: string, model?: string, output: any[], usage?: any, error?: any, incomplete_details?: any}} parts - Per-response parts.
|
|
52
|
+
* @returns {any} Response object.
|
|
53
|
+
*/
|
|
54
|
+
export function envelope(state: any, parts: {
|
|
55
|
+
id: string;
|
|
56
|
+
created: number;
|
|
57
|
+
status: string;
|
|
58
|
+
model?: string;
|
|
59
|
+
output: any[];
|
|
60
|
+
usage?: any;
|
|
61
|
+
error?: any;
|
|
62
|
+
incomplete_details?: any;
|
|
63
|
+
}): any;
|
|
64
|
+
/**
|
|
65
|
+
* A failure's `{ code, message }` for a response in the `failed` status.
|
|
66
|
+
* @param {any} error - Chat error object (`{ message, type, code }`) or anything else thrown.
|
|
67
|
+
* @returns {{code: string, message: string}} Error as a response carries it.
|
|
68
|
+
*/
|
|
69
|
+
export function failureOf(error: any): {
|
|
70
|
+
code: string;
|
|
71
|
+
message: string;
|
|
72
|
+
};
|
|
@@ -31,14 +31,16 @@ export function pick(config: any, endpoints: any[], model: string | undefined, s
|
|
|
31
31
|
* Validate a client request body and resolve where it goes. Shared by `request` and `route` so both always agree.
|
|
32
32
|
* @param {any} c - Captured translator parts (`capture`).
|
|
33
33
|
* @param {any} body - Client request body.
|
|
34
|
-
* @param {{endpoint?: string, advance?: boolean}} [options] - `endpoint` forces one pool member by name (used for failover; it must still serve the model, else `endpoint_not_in_pool`); `advance` moves the round robin cursor (`request` does, `route` does not).
|
|
35
|
-
* @returns {{endpoint: any, model: string, requested: string | undefined, unserved: boolean, pin: {effort?: string, thinking?: boolean} | undefined, convert: any, pool: any[]}} The chosen endpoint, the model name sent
|
|
36
|
-
* upstream, the model the client asked for, whether no endpoint serves it, the settings its alias pins, the converters (null for a native pass-through) and the pool in try order.
|
|
34
|
+
* @param {{endpoint?: string, advance?: boolean, wire?: string, tokens?: boolean}} [options] - `wire: "responses"` marks a request that came in on the Responses API; `endpoint` forces one pool member by name (used for failover; it must still serve the model, else `endpoint_not_in_pool`); `advance` moves the round robin cursor (`request` does, `route` does not).
|
|
35
|
+
* @returns {{endpoint: any, model: string, requested: string | undefined, unserved: boolean, pin: {effort?: string, thinking?: boolean} | undefined, convert: any, protocol: string, more: boolean, pool: any[]}} The chosen endpoint, the model name sent
|
|
36
|
+
* upstream, the model the client asked for, whether no endpoint serves it, the settings its alias pins, the protocol it goes over (`protocol`, see `lib/protocol`), whether an `auto` upstream has another to fall back to (`more`), the converters (null for a native pass-through) and the pool in try order.
|
|
37
37
|
* @throws {TranslatorError} `invalid_body` when the body is not a JSON object, `endpoint_not_in_pool` when a forced endpoint no longer serves the model.
|
|
38
38
|
*/
|
|
39
39
|
export function resolve(c: any, body: any, options?: {
|
|
40
40
|
endpoint?: string;
|
|
41
41
|
advance?: boolean;
|
|
42
|
+
wire?: string;
|
|
43
|
+
tokens?: boolean;
|
|
42
44
|
}): {
|
|
43
45
|
endpoint: any;
|
|
44
46
|
model: string;
|
|
@@ -49,5 +51,7 @@ export function resolve(c: any, body: any, options?: {
|
|
|
49
51
|
thinking?: boolean;
|
|
50
52
|
} | undefined;
|
|
51
53
|
convert: any;
|
|
54
|
+
protocol: string;
|
|
55
|
+
more: boolean;
|
|
52
56
|
pool: any[];
|
|
53
57
|
};
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
* @param {Promise<any>} sending - Pending `send` result.
|
|
5
5
|
* @param {any} api - Captured translator parts.
|
|
6
6
|
* @param {string} [model] - Model the client asked for (used in the early `message_start`).
|
|
7
|
+
* @param {(source: AsyncIterable<any>) => AsyncIterable<any>} [convert] - Turns the upstream's stream into the client's events (the Responses front).
|
|
7
8
|
* @returns {AsyncGenerator<any>} Client events.
|
|
8
9
|
*/
|
|
9
|
-
export function late(sending: Promise<any>, api: any, model?: string): AsyncGenerator<any>;
|
|
10
|
+
export function late(sending: Promise<any>, api: any, model?: string, convert?: (source: AsyncIterable<any>) => AsyncIterable<any>): AsyncGenerator<any>;
|
|
10
11
|
/**
|
|
11
12
|
* Register the routes for one front on a Fastify instance.
|
|
12
13
|
* @param {any} fastify - Fastify instance (usually an encapsulated plugin scope).
|
|
13
|
-
* @param {any} options - `{ apiKey, bodyLimit, authorize, onUsage }`.
|
|
14
|
+
* @param {any} options - `{ apiKey, bodyLimit, authorize, onUsage, metrics, cors, rateLimit }`.
|
|
14
15
|
* @param {any} captured - Captured translator parts `{ front, interval(body), filter, send, route, count, list, get, build, encode, write }`; `front` applies to this instance only.
|
|
15
16
|
* @returns {void}
|
|
16
17
|
*/
|
|
@@ -14,6 +14,7 @@ export function resolve(...layers: (Partial<Settings> | null | undefined)[]): Se
|
|
|
14
14
|
* @property {boolean} thinkTags - Parse a leading `<think>...</think>` in content as reasoning.
|
|
15
15
|
* @property {boolean} thinkOpen - With `thinkTags`: the output starts inside a thought because the chat template opens `<think>` in the generation prompt, so reasoning runs up to the first `</think>`. Without a `</think>` the content is plain text.
|
|
16
16
|
* @property {boolean} reasoningRoundTrip - Carry reasoning the upstream needs back across turns. OpenAI-protocol upstream: the provider's reasoning fields (`reasoning_content`, `reasoning`, `reasoning_details`) travel in the thinking block's `llmt:` signature and are restored on the next request. Anthropic-protocol upstream with an OpenAI client: thinking blocks and their signatures travel as `reasoning_details` items the client replays. Off by default; the DeepSeek driver turns it on.
|
|
17
|
+
* @property {"auto"|"concise"|"detailed"|"none"} reasoningSummary - Responses-protocol upstream: the `reasoning.summary` asked for whenever the request sets a reasoning effort, so the model's reasoning summary comes back as thinking text. `none` does not ask for one.
|
|
17
18
|
* @property {"chat_template_kwargs"|"reasoning_effort"|"none"} thinking - How Anthropic `thinking` is requested from the server.
|
|
18
19
|
* @property {boolean} thinkingBudget - Send `thinking_token_budget` for `thinking.type = "enabled"`.
|
|
19
20
|
* @property {boolean} effort - Map `output_config.effort` to `reasoning_effort`.
|
|
@@ -28,9 +29,9 @@ export function resolve(...layers: (Partial<Settings> | null | undefined)[]): Se
|
|
|
28
29
|
* @property {"expand"|"inline"|"native"} toolSearch - Claude Code's tool search. `expand` offers a deferred tool once a `tool_reference` (or a `ToolSearch` result) loads it; `inline` offers every deferred tool up front and hides `ToolSearch` (it stays when `DeferredToolPlaceholder` shows Claude Code holds tools whose definitions it did not send; `expand` does the same when the request has no `ToolSearch` at all); `native` passes `defer_loading` and `tool_reference` through to a server that understands them.
|
|
29
30
|
* @property {"schema"|"instruction"|"drop"} jsonObject - OpenAI to Anthropic: how `response_format: json_object` is sent. `schema` sends `output_config.format` with the permissive schema `{ "type": "object" }`, `instruction` appends a short system instruction asking for one JSON object, `drop` omits it and records the drop.
|
|
30
31
|
* @property {boolean} jsonObjectFallback - Retry a request once with `jsonObject: "instruction"` when an Anthropic-protocol upstream answers 400 or 422 to the schema `jsonObject: "schema"` sent. The endpoint and model are remembered until the process ends only when the retry succeeds.
|
|
31
|
-
* @property {boolean} toolErrors - Prefix `is_error` tool results with `toolErrorMarker
|
|
32
|
+
* @property {boolean} toolErrors - Prefix `is_error` tool results with `toolErrorMarker` when converting to Chat Completions (which has no error flag) and on vLLM native passthrough. On by default for every driver; set false to send the text unchanged. Upstreams with a native error flag (Anthropic-protocol) never go through this.
|
|
32
33
|
* @property {string} toolErrorMarker - Text that marks a failed tool result when `toolErrors` is on, and the text `toolErrorInference` looks for. Must contain a non-whitespace character.
|
|
33
|
-
* @property {boolean} toolErrorInference - OpenAI to Anthropic: a `tool` message whose text starts with `toolErrorMarker` becomes a `tool_result` with `is_error: true`, with the marker removed from the text.
|
|
34
|
+
* @property {boolean} toolErrorInference - OpenAI to Anthropic: a `tool` message whose text starts with `toolErrorMarker` becomes a `tool_result` with `is_error: true`, with the marker removed from the text. Off by default: a tool that merely prints the marker would be taken for a failure.
|
|
34
35
|
* @property {"max_completion_tokens"|"max_tokens"} maxTokensField - Field used for the output cap.
|
|
35
36
|
* @property {boolean} streamUsage - Request `stream_options.include_usage` on streamed requests.
|
|
36
37
|
* @property {boolean} continuousUsage - Also request `stream_options.continuous_usage_stats` (vLLM extension; real OpenAI may reject it).
|
|
@@ -47,7 +48,7 @@ export function resolve(...layers: (Partial<Settings> | null | undefined)[]): Se
|
|
|
47
48
|
* @property {"buffer"|"stream"} toolStreaming - OpenAI to Anthropic streams: `buffer` holds each tool call until its arguments are complete and emits one whole `tool_use` block (text and thinking keep streaming and appear before the block); `stream` forwards argument fragments incrementally and holds text that arrives meanwhile until the tool blocks are done.
|
|
48
49
|
* @property {boolean} effortPassthrough - vLLM driver: send `xhigh` and `max` reasoning effort unchanged instead of clamping them to `high`.
|
|
49
50
|
* @property {boolean} passthroughFilter - Restrict bodies forwarded from the OpenAI front to an OpenAI-protocol upstream to standard Chat Completions fields plus documented vLLM extensions. Off in the library; the server turns it on unless set to false.
|
|
50
|
-
* @property {boolean | "auto"} nativeMessages -
|
|
51
|
+
* @property {boolean | "auto"} nativeMessages - Deprecated: use the upstream's `api` instead. For a vLLM upstream that sets no `api`, `true` reads as `api: "anthropic.messages"`, `"auto"` as `api: "auto"` and `false` as `api: "openai.chat"`, with a deprecation warning; it is ignored (also with a warning) when `api` is set.
|
|
51
52
|
* @property {number} contextWindow - Prompt size in tokens the upstream truncates at, or 0 when unknown. Drivers whose server silently truncates (Ollama) warn once when a request is estimated to exceed it.
|
|
52
53
|
* @property {number} defaultMaxTokens - `max_tokens` used when an OpenAI request has none (Anthropic requires one).
|
|
53
54
|
*/
|
|
@@ -81,6 +82,10 @@ export type Settings = {
|
|
|
81
82
|
* - Carry reasoning the upstream needs back across turns. OpenAI-protocol upstream: the provider's reasoning fields (`reasoning_content`, `reasoning`, `reasoning_details`) travel in the thinking block's `llmt:` signature and are restored on the next request. Anthropic-protocol upstream with an OpenAI client: thinking blocks and their signatures travel as `reasoning_details` items the client replays. Off by default; the DeepSeek driver turns it on.
|
|
82
83
|
*/
|
|
83
84
|
reasoningRoundTrip: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* - Responses-protocol upstream: the `reasoning.summary` asked for whenever the request sets a reasoning effort, so the model's reasoning summary comes back as thinking text. `none` does not ask for one.
|
|
87
|
+
*/
|
|
88
|
+
reasoningSummary: "auto" | "concise" | "detailed" | "none";
|
|
84
89
|
/**
|
|
85
90
|
* - How Anthropic `thinking` is requested from the server.
|
|
86
91
|
*/
|
|
@@ -144,7 +149,7 @@ export type Settings = {
|
|
|
144
149
|
*/
|
|
145
150
|
jsonObjectFallback: boolean;
|
|
146
151
|
/**
|
|
147
|
-
* - Prefix `is_error` tool results with `toolErrorMarker
|
|
152
|
+
* - Prefix `is_error` tool results with `toolErrorMarker` when converting to Chat Completions (which has no error flag) and on vLLM native passthrough. On by default for every driver; set false to send the text unchanged. Upstreams with a native error flag (Anthropic-protocol) never go through this.
|
|
148
153
|
*/
|
|
149
154
|
toolErrors: boolean;
|
|
150
155
|
/**
|
|
@@ -152,7 +157,7 @@ export type Settings = {
|
|
|
152
157
|
*/
|
|
153
158
|
toolErrorMarker: string;
|
|
154
159
|
/**
|
|
155
|
-
* - OpenAI to Anthropic: a `tool` message whose text starts with `toolErrorMarker` becomes a `tool_result` with `is_error: true`, with the marker removed from the text.
|
|
160
|
+
* - OpenAI to Anthropic: a `tool` message whose text starts with `toolErrorMarker` becomes a `tool_result` with `is_error: true`, with the marker removed from the text. Off by default: a tool that merely prints the marker would be taken for a failure.
|
|
156
161
|
*/
|
|
157
162
|
toolErrorInference: boolean;
|
|
158
163
|
/**
|
|
@@ -225,7 +230,7 @@ export type Settings = {
|
|
|
225
230
|
*/
|
|
226
231
|
passthroughFilter: boolean;
|
|
227
232
|
/**
|
|
228
|
-
* -
|
|
233
|
+
* - Deprecated: use the upstream's `api` instead. For a vLLM upstream that sets no `api`, `true` reads as `api: "anthropic.messages"`, `"auto"` as `api: "auto"` and `false` as `api: "openai.chat"`, with a deprecation warning; it is ignored (also with a warning) when `api` is set.
|
|
229
234
|
*/
|
|
230
235
|
nativeMessages: boolean | "auto";
|
|
231
236
|
/**
|
package/types/src/lib/vllm.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* May `/v1/messages` be tried on this upstream without being asked for? Only when the detected or configured version is known and is 0.11.1 or later:
|
|
3
|
+
* an older server has no such route, and an unknown version stays on Chat Completions (set `api` to use the route anyway).
|
|
3
4
|
* @param {any} endpoint - Runtime endpoint.
|
|
4
|
-
* @
|
|
5
|
-
* @returns {boolean} True for a vLLM upstream with `nativeMessages: true`, or `"auto"` and a known version of 0.11.1 or later (an unknown version stays on conversion).
|
|
5
|
+
* @returns {boolean} True for a vLLM upstream with a known version of 0.11.1 or later.
|
|
6
6
|
*/
|
|
7
|
-
export function
|
|
7
|
+
export function eligible(endpoint: any): boolean;
|
|
8
8
|
/**
|
|
9
9
|
* Why a request cannot go to the native endpoint, so it is converted instead.
|
|
10
10
|
*
|