@cldmv/llm-translator 0.2.0 → 0.3.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.
Files changed (166) hide show
  1. package/README.md +12 -6
  2. package/dist/api/convert/anthropic/messages/to/openai/chat/request.mjs +11 -11
  3. package/dist/api/convert/anthropic/messages/to/openai/chat/response.mjs +1 -1
  4. package/dist/api/convert/anthropic/messages/to/openai/chat/stream.mjs +1 -1
  5. package/dist/api/convert/openai/chat/to/anthropic/messages/request.mjs +3 -3
  6. package/dist/api/convert/openai/chat/to/anthropic/messages/response.mjs +1 -1
  7. package/dist/api/convert/openai/chat/to/anthropic/messages/stream.mjs +1 -1
  8. package/dist/api/detect.mjs +1 -1
  9. package/dist/api/driver/anthropic/token/count.mjs +1 -1
  10. package/dist/api/driver/compatible/detect.mjs +1 -1
  11. package/dist/api/driver/compatible/info.mjs +1 -1
  12. package/dist/api/driver/deepseek/detect.mjs +2 -0
  13. package/dist/api/driver/deepseek/error.mjs +2 -0
  14. package/dist/api/driver/deepseek/info.mjs +2 -0
  15. package/dist/api/driver/deepseek/request.mjs +2 -0
  16. package/dist/api/driver/deepseek/settings.mjs +2 -0
  17. package/dist/api/driver/llamacpp/chunk.mjs +2 -0
  18. package/dist/api/driver/llamacpp/detect.mjs +2 -0
  19. package/dist/api/driver/llamacpp/flush.mjs +2 -0
  20. package/dist/api/driver/llamacpp/info.mjs +2 -0
  21. package/dist/api/driver/llamacpp/request.mjs +2 -0
  22. package/dist/api/driver/llamacpp/response.mjs +2 -0
  23. package/dist/api/driver/llamacpp/settings.mjs +2 -0
  24. package/dist/api/driver/ollama/detect.mjs +2 -0
  25. package/dist/api/driver/ollama/info.mjs +2 -0
  26. package/dist/api/driver/ollama/request.mjs +2 -0
  27. package/dist/api/driver/ollama/settings.mjs +2 -0
  28. package/dist/api/driver/sglang/detect.mjs +2 -0
  29. package/dist/api/driver/sglang/info.mjs +2 -0
  30. package/dist/api/driver/sglang/request.mjs +2 -0
  31. package/dist/api/driver/sglang/settings.mjs +2 -0
  32. package/dist/api/driver/vllm/detect.mjs +1 -1
  33. package/dist/api/driver/vllm/info.mjs +1 -1
  34. package/dist/api/endpoint/status.mjs +2 -0
  35. package/dist/api/error/error.mjs +1 -1
  36. package/dist/api/model/get.mjs +2 -0
  37. package/dist/api/request.mjs +2 -2
  38. package/dist/api/route.mjs +2 -0
  39. package/dist/api/send.mjs +1 -1
  40. package/dist/api/server/plugin.mjs +1 -1
  41. package/dist/api/server/start.mjs +1 -1
  42. package/dist/api/status.mjs +1 -1
  43. package/dist/api/stream.mjs +1 -1
  44. package/dist/index.cjs +3 -3
  45. package/dist/index.mjs +1 -1
  46. package/dist/lib/backends.mjs +2 -0
  47. package/dist/lib/capture.mjs +1 -1
  48. package/dist/lib/cli.mjs +1 -1
  49. package/dist/lib/config.mjs +1 -1
  50. package/dist/lib/estimate.mjs +1 -1
  51. package/dist/lib/http.mjs +1 -1
  52. package/dist/lib/ids.mjs +1 -1
  53. package/dist/lib/models.mjs +1 -1
  54. package/dist/lib/passthrough.mjs +1 -1
  55. package/dist/lib/pool.mjs +2 -0
  56. package/dist/lib/route.mjs +1 -1
  57. package/dist/lib/routes.mjs +1 -1
  58. package/dist/lib/settings.mjs +1 -1
  59. package/dist/lib/thinking.mjs +2 -1
  60. package/dist/lib/tools.mjs +2 -0
  61. package/dist/lib/toolsearch.mjs +3 -0
  62. package/dist/lib/transport.mjs +1 -1
  63. package/dist/lib/usage.mjs +2 -0
  64. package/package.json +13 -7
  65. package/types/src/api/convert/anthropic/messages/to/openai/chat/request.d.mts +6 -15
  66. package/types/src/api/convert/anthropic/messages/to/openai/chat/response.d.mts +3 -16
  67. package/types/src/api/convert/anthropic/messages/to/openai/chat/stream.d.mts +1 -15
  68. package/types/src/api/convert/openai/chat/to/anthropic/messages/request.d.mts +1 -15
  69. package/types/src/api/convert/openai/chat/to/anthropic/messages/response.d.mts +3 -17
  70. package/types/src/api/convert/openai/chat/to/anthropic/messages/stream.d.mts +1 -15
  71. package/types/src/api/detect.d.mts +1 -15
  72. package/types/src/api/driver/anthropic/detect.d.mts +1 -1
  73. package/types/src/api/driver/anthropic/info.d.mts +1 -1
  74. package/types/src/api/driver/anthropic/model/list.d.mts +1 -15
  75. package/types/src/api/driver/anthropic/settings.d.mts +1 -1
  76. package/types/src/api/driver/anthropic/token/count.d.mts +1 -15
  77. package/types/src/api/driver/compatible/detect.d.mts +2 -16
  78. package/types/src/api/driver/compatible/info.d.mts +3 -20
  79. package/types/src/api/driver/compatible/model/list.d.mts +1 -15
  80. package/types/src/api/driver/compatible/request.d.mts +1 -15
  81. package/types/src/api/driver/compatible/settings.d.mts +1 -1
  82. package/types/src/api/driver/deepseek/detect.d.mts +26 -0
  83. package/types/src/api/driver/deepseek/error.d.mts +14 -0
  84. package/types/src/api/driver/deepseek/info.d.mts +29 -0
  85. package/types/src/api/driver/deepseek/request.d.mts +8 -0
  86. package/types/src/api/driver/deepseek/settings.d.mts +25 -0
  87. package/types/src/api/driver/llamacpp/chunk.d.mts +7 -0
  88. package/types/src/api/driver/llamacpp/detect.d.mts +6 -0
  89. package/types/src/api/driver/llamacpp/flush.d.mts +26 -0
  90. package/types/src/api/driver/llamacpp/info.d.mts +31 -0
  91. package/types/src/api/driver/llamacpp/request.d.mts +8 -0
  92. package/types/src/api/driver/llamacpp/response.d.mts +8 -0
  93. package/types/src/api/driver/llamacpp/settings.d.mts +27 -0
  94. package/types/src/api/driver/ollama/detect.d.mts +6 -0
  95. package/types/src/api/driver/ollama/info.d.mts +30 -0
  96. package/types/src/api/driver/ollama/request.d.mts +8 -0
  97. package/types/src/api/driver/ollama/settings.d.mts +7 -0
  98. package/types/src/api/driver/openai/detect.d.mts +1 -1
  99. package/types/src/api/driver/openai/info.d.mts +1 -1
  100. package/types/src/api/driver/openai/model/list.d.mts +1 -15
  101. package/types/src/api/driver/openai/request.d.mts +1 -15
  102. package/types/src/api/driver/openai/settings.d.mts +1 -1
  103. package/types/src/api/driver/sglang/detect.d.mts +6 -0
  104. package/types/src/api/driver/sglang/info.d.mts +31 -0
  105. package/types/src/api/driver/sglang/request.d.mts +8 -0
  106. package/types/src/api/driver/sglang/settings.d.mts +24 -0
  107. package/types/src/api/driver/vllm/detect.d.mts +3 -17
  108. package/types/src/api/driver/vllm/error.d.mts +1 -15
  109. package/types/src/api/driver/vllm/info.d.mts +3 -20
  110. package/types/src/api/driver/vllm/model/list.d.mts +1 -15
  111. package/types/src/api/driver/vllm/probe.d.mts +1 -15
  112. package/types/src/api/driver/vllm/request.d.mts +1 -15
  113. package/types/src/api/driver/vllm/settings.d.mts +1 -15
  114. package/types/src/api/driver/vllm/token/count.d.mts +1 -15
  115. package/types/src/api/endpoint/status.d.mts +27 -0
  116. package/types/src/api/error/build.d.mts +1 -15
  117. package/types/src/api/error/error.d.mts +1 -15
  118. package/types/src/api/model/get.d.mts +9 -0
  119. package/types/src/api/model/list.d.mts +1 -15
  120. package/types/src/api/request.d.mts +8 -17
  121. package/types/src/api/response.d.mts +1 -15
  122. package/types/src/api/route.d.mts +18 -0
  123. package/types/src/api/send.d.mts +21 -16
  124. package/types/src/api/server/plugin.d.mts +6 -19
  125. package/types/src/api/server/start.d.mts +2 -16
  126. package/types/src/api/server/stop.d.mts +1 -15
  127. package/types/src/api/sse/encode.d.mts +1 -15
  128. package/types/src/api/sse/parse.d.mts +1 -15
  129. package/types/src/api/sse/ping.d.mts +1 -15
  130. package/types/src/api/sse/write.d.mts +1 -15
  131. package/types/src/api/status.d.mts +2 -16
  132. package/types/src/api/stream.d.mts +1 -15
  133. package/types/src/api/token/count.d.mts +1 -15
  134. package/types/src/index.d.mts +24 -34
  135. package/types/src/lib/arguments.d.mts +2 -16
  136. package/types/src/lib/backends.d.mts +21 -0
  137. package/types/src/lib/capture.d.mts +2 -16
  138. package/types/src/lib/cli.d.mts +12 -26
  139. package/types/src/lib/config.d.mts +11 -25
  140. package/types/src/lib/documents.d.mts +16 -27
  141. package/types/src/lib/errors.d.mts +75 -75
  142. package/types/src/lib/estimate.d.mts +58 -7
  143. package/types/src/lib/finish.d.mts +4 -4
  144. package/types/src/lib/http.d.mts +19 -5
  145. package/types/src/lib/ids.d.mts +11 -20
  146. package/types/src/lib/images.d.mts +19 -19
  147. package/types/src/lib/models.d.mts +13 -13
  148. package/types/src/lib/normalize.d.mts +3 -3
  149. package/types/src/lib/passthrough.d.mts +11 -17
  150. package/types/src/lib/pdf.d.mts +4 -18
  151. package/types/src/lib/ping.d.mts +1 -15
  152. package/types/src/lib/pool.d.mts +124 -0
  153. package/types/src/lib/route.d.mts +31 -24
  154. package/types/src/lib/routes.d.mts +10 -15
  155. package/types/src/lib/runtime.d.mts +2 -16
  156. package/types/src/lib/schema.d.mts +1 -15
  157. package/types/src/lib/settings.d.mts +68 -54
  158. package/types/src/lib/source.d.mts +2 -2
  159. package/types/src/lib/sse.d.mts +21 -32
  160. package/types/src/lib/thinking.d.mts +117 -22
  161. package/types/src/lib/tools.d.mts +28 -0
  162. package/types/src/lib/toolsearch.d.mts +91 -0
  163. package/types/src/lib/transport.d.mts +3 -16
  164. package/types/src/lib/upstream-error.d.mts +4 -18
  165. package/types/src/lib/usage.d.mts +91 -0
  166. package/types/src/lib/warn.d.mts +1 -1
@@ -21,6 +21,6 @@
21
21
  * @param {any} context - `{ endpoint }`.
22
22
  * @returns {{host: string} | null} Facts, or null when the endpoint is not api.anthropic.com.
23
23
  */
24
- export declare function detect({ endpoint }: any): {
24
+ export function detect({ endpoint }: any): {
25
25
  host: string;
26
26
  } | null;
@@ -20,7 +20,7 @@
20
20
  * Describe the Anthropic driver (native Messages API upstream).
21
21
  * @returns {{name: string, protocol: string, order: number, auth: string, headers: Record<string,string>, paths: Record<string,string>}} Driver facts.
22
22
  */
23
- export declare function info(): {
23
+ export function info(): {
24
24
  name: string;
25
25
  protocol: string;
26
26
  order: number;
@@ -1,20 +1,6 @@
1
- /**
2
- *
3
- * @Project: @cldmv/llm-translator
4
- * @Filename: /src/api/driver/anthropic/model/list.mjs
5
- * @Date: 2026-10-25T12:29:36-07:00 (1792956576)
6
- * @Author: Nate Corcoran <CLDMV>
7
- * @Email: <Shinrai@users.noreply.github.com>
8
- * -----
9
- * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
- * @Last modified time: 2026-10-25T12:58:59-07:00 (1792958339)
11
- * -----
12
- * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
- *
14
- */
15
1
  /**
16
2
  * List the models the Anthropic API reports.
17
3
  * @param {any} context - `{ endpoint, transport, signal, timeout }`.
18
4
  * @returns {Promise<any[] | null>} Models, or null when unreachable.
19
5
  */
20
- export declare function list(context: any): Promise<any[] | null>;
6
+ export function list(context: any): Promise<any[] | null>;
@@ -20,4 +20,4 @@
20
20
  * The Messages API needs no special settings; the converters use the library defaults.
21
21
  * @returns {any} Partial settings (empty).
22
22
  */
23
- export declare function settings(): any;
23
+ export function settings(): any;
@@ -1,20 +1,6 @@
1
- /**
2
- *
3
- * @Project: @cldmv/llm-translator
4
- * @Filename: /src/api/driver/anthropic/token/count.mjs
5
- * @Date: 2026-10-25T12:29:36-07:00 (1792956576)
6
- * @Author: Nate Corcoran <CLDMV>
7
- * @Email: <Shinrai@users.noreply.github.com>
8
- * -----
9
- * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
- * @Last modified time: 2026-10-25T12:58:59-07:00 (1792958339)
11
- * -----
12
- * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
- *
14
- */
15
1
  /**
16
2
  * Count tokens with the Anthropic API.
17
3
  * @param {any} context - `{ endpoint, request, transport, signal, timeout }`.
18
4
  * @returns {Promise<number | null>} Token count, or null when the API did not answer.
19
5
  */
20
- export declare function count({ endpoint, request, transport, signal, timeout }: any): Promise<number | null>;
6
+ export function count({ endpoint, request, transport, signal, timeout }: any): Promise<number | null>;
@@ -1,23 +1,9 @@
1
- /**
2
- *
3
- * @Project: @cldmv/llm-translator
4
- * @Filename: /src/api/driver/compatible/detect.mjs
5
- * @Date: 2026-10-25T12:29:36-07:00 (1792956576)
6
- * @Author: Nate Corcoran <CLDMV>
7
- * @Email: <Shinrai@users.noreply.github.com>
8
- * -----
9
- * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
- * @Last modified time: 2026-10-25T12:58:59-07:00 (1792958339)
11
- * -----
12
- * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
- *
14
- */
15
1
  /**
16
2
  * Probe `/v1/models` for reachability and the served model ids. Never returns null: this driver is the fallback.
17
- * @param {any} context - `{ endpoint, transport, signal, timeout }`.
3
+ * @param {any} context - `{ endpoint, transport, signal, timeout, probes }`.
18
4
  * @returns {Promise<{reachable: boolean, models: string[]}>} Facts.
19
5
  */
20
- export declare function detect(context: any): Promise<{
6
+ export function detect(context: any): Promise<{
21
7
  reachable: boolean;
22
8
  models: string[];
23
9
  }>;
@@ -1,29 +1,12 @@
1
- /**
2
- *
3
- * @Project: @cldmv/llm-translator
4
- * @Filename: /src/api/driver/compatible/info.mjs
5
- * @Date: 2026-10-25T12:29:36-07:00 (1792956576)
6
- * @Author: Nate Corcoran <CLDMV>
7
- * @Email: <Shinrai@users.noreply.github.com>
8
- * -----
9
- * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
- * @Last modified time: 2026-10-25T12:58:59-07:00 (1792958339)
11
- * -----
12
- * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
- *
14
- */
15
- /**
16
- * @fileoverview Generic OpenAI-compatible driver: static facts about the backend.
17
- * @module @cldmv/llm-translator/driver/compatible
18
- */
19
1
  /**
20
2
  * Describe the generic OpenAI-compatible driver (matches last, after every specific driver).
21
- * @returns {{name: string, protocol: string, order: number, auth: string, paths: Record<string,string>}} Driver facts.
3
+ * @returns {{name: string, protocol: string, order: number, auth: string, fields: string[], paths: Record<string,string>}} Driver facts.
22
4
  */
23
- export declare function info(): {
5
+ export function info(): {
24
6
  name: string;
25
7
  protocol: string;
26
8
  order: number;
27
9
  auth: string;
10
+ fields: string[];
28
11
  paths: Record<string, string>;
29
12
  };
@@ -1,20 +1,6 @@
1
- /**
2
- *
3
- * @Project: @cldmv/llm-translator
4
- * @Filename: /src/api/driver/compatible/model/list.mjs
5
- * @Date: 2026-10-25T12:29:36-07:00 (1792956576)
6
- * @Author: Nate Corcoran <CLDMV>
7
- * @Email: <Shinrai@users.noreply.github.com>
8
- * -----
9
- * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
- * @Last modified time: 2026-10-25T12:58:59-07:00 (1792958339)
11
- * -----
12
- * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
- *
14
- */
15
1
  /**
16
2
  * List the models the server reports.
17
3
  * @param {any} context - `{ endpoint, transport, signal, timeout }`.
18
4
  * @returns {Promise<any[] | null>} Models, or null when unreachable.
19
5
  */
20
- export declare function list(context: any): Promise<any[] | null>;
6
+ export function list(context: any): Promise<any[] | null>;
@@ -1,20 +1,6 @@
1
- /**
2
- *
3
- * @Project: @cldmv/llm-translator
4
- * @Filename: /src/api/driver/compatible/request.mjs
5
- * @Date: 2026-10-25T12:29:36-07:00 (1792956576)
6
- * @Author: Nate Corcoran <CLDMV>
7
- * @Email: <Shinrai@users.noreply.github.com>
8
- * -----
9
- * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
- * @Last modified time: 2026-10-25T12:58:59-07:00 (1792958339)
11
- * -----
12
- * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
- *
14
- */
15
1
  /**
16
2
  * Drop tool fields servers reject when no tools are present.
17
3
  * @param {any} body - Chat Completions request body.
18
4
  * @returns {any} Normalized body.
19
5
  */
20
- export declare function request(body: any): any;
6
+ export function request(body: any): any;
@@ -20,4 +20,4 @@
20
20
  * Settings that avoid fields unknown servers may reject. Override per upstream with `settings`.
21
21
  * @returns {any} Partial settings.
22
22
  */
23
- export declare function settings(): any;
23
+ export function settings(): any;
@@ -0,0 +1,26 @@
1
+ /**
2
+ *
3
+ * @Project: @cldmv/llm-translator
4
+ * @Filename: /src/api/driver/deepseek/detect.mjs
5
+ * @Date: 2026-10-31T14:00:00-07:00 (1793480400)
6
+ * @Author: Nate Corcoran <CLDMV>
7
+ * @Email: <Shinrai@users.noreply.github.com>
8
+ * -----
9
+ * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
+ * @Last modified time: 2026-10-31T14:00:00-07:00 (1793480400)
11
+ * -----
12
+ * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
+ *
14
+ */
15
+ /**
16
+ * @fileoverview DeepSeek driver: matches the api.deepseek.com host.
17
+ * @module @cldmv/llm-translator/driver/deepseek
18
+ */
19
+ /**
20
+ * Match by host name, no network access.
21
+ * @param {any} context - `{ endpoint }`.
22
+ * @returns {{host: string} | null} Facts, or null when the endpoint is not api.deepseek.com.
23
+ */
24
+ export function detect({ endpoint }: any): {
25
+ host: string;
26
+ } | null;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Normalize to the nested OpenAI shape and explain DeepSeek's `reasoning_content` refusal.
3
+ * @param {number} status - HTTP status.
4
+ * @param {*} body - Parsed upstream error body.
5
+ * @returns {{error: {message: string, type: string | undefined, param: *, code: *}}} Nested error body.
6
+ */
7
+ export function error(status: number, body: any): {
8
+ error: {
9
+ message: string;
10
+ type: string | undefined;
11
+ param: any;
12
+ code: any;
13
+ };
14
+ };
@@ -0,0 +1,29 @@
1
+ /**
2
+ *
3
+ * @Project: @cldmv/llm-translator
4
+ * @Filename: /src/api/driver/deepseek/info.mjs
5
+ * @Date: 2026-10-31T14:00:00-07:00 (1793480400)
6
+ * @Author: Nate Corcoran <CLDMV>
7
+ * @Email: <Shinrai@users.noreply.github.com>
8
+ * -----
9
+ * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
+ * @Last modified time: 2026-10-31T14:00:00-07:00 (1793480400)
11
+ * -----
12
+ * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
+ *
14
+ */
15
+ /**
16
+ * @fileoverview DeepSeek driver: static facts about the hosted DeepSeek API.
17
+ * @module @cldmv/llm-translator/driver/deepseek
18
+ */
19
+ /**
20
+ * Describe the DeepSeek driver.
21
+ * @returns {{name: string, protocol: string, order: number, auth: string, paths: Record<string,string>}} Driver facts.
22
+ */
23
+ export function info(): {
24
+ name: string;
25
+ protocol: string;
26
+ order: number;
27
+ auth: string;
28
+ paths: Record<string, string>;
29
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Drop tool fields when there are no tools. In thinking mode also remove what DeepSeek rejects there: `tool_choice` of `required` or a named
3
+ * function (`auto` and `none` stay) and `logprobs`/`top_logprobs`; each removal is recorded in `state.dropped`.
4
+ * @param {any} body - Chat Completions request body.
5
+ * @param {any} [ctx] - `{ state }`.
6
+ * @returns {any} Normalized body.
7
+ */
8
+ export function request(body: any, ctx?: any): any;
@@ -0,0 +1,25 @@
1
+ /**
2
+ *
3
+ * @Project: @cldmv/llm-translator
4
+ * @Filename: /src/api/driver/deepseek/settings.mjs
5
+ * @Date: 2026-10-31T14:00:00-07:00 (1793480400)
6
+ * @Author: Nate Corcoran <CLDMV>
7
+ * @Email: <Shinrai@users.noreply.github.com>
8
+ * -----
9
+ * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
+ * @Last modified time: 2026-10-31T14:00:00-07:00 (1793480400)
11
+ * -----
12
+ * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
+ *
14
+ */
15
+ /**
16
+ * @fileoverview DeepSeek driver: translator settings for the hosted DeepSeek API.
17
+ * @module @cldmv/llm-translator/driver/deepseek
18
+ */
19
+ /**
20
+ * Settings for api.deepseek.com: reasoning in `reasoning_content`, no `top_k`, no prefill continuation, `json_object` response format only
21
+ * (no `json_schema`), text-only models, and usage on the last content chunk (read as for any server). Thinking is chosen by the model name, so no
22
+ * thinking switch is sent.
23
+ * @returns {any} Partial settings.
24
+ */
25
+ export function settings(): any;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Normalize a streamed chunk: drop the duplicate reasoning block of `deepseek-legacy` and give tool calls without an id one.
3
+ * @param {any} chunk - Parsed `chat.completion.chunk`.
4
+ * @param {any} [ctx] - `{ state }`.
5
+ * @returns {any} Normalized chunk.
6
+ */
7
+ export function chunk(chunk: any, ctx?: any): any;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Probe an endpoint for `llama-server`.
3
+ * @param {any} context - `{ endpoint, transport, signal, timeout, probes }`.
4
+ * @returns {Promise<any | null>} Facts `{ models, build, vision }`, or null when the endpoint is not llama-server.
5
+ */
6
+ export function detect(context: any): Promise<any | null>;
@@ -0,0 +1,26 @@
1
+ /**
2
+ *
3
+ * @Project: @cldmv/llm-translator
4
+ * @Filename: /src/api/driver/llamacpp/flush.mjs
5
+ * @Date: 2026-10-31T14:00:00-07:00 (1793480400)
6
+ * @Author: Nate Corcoran <CLDMV>
7
+ * @Email: <Shinrai@users.noreply.github.com>
8
+ * -----
9
+ * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
+ * @Last modified time: 2026-10-31T14:00:00-07:00 (1793480400)
11
+ * -----
12
+ * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
+ *
14
+ */
15
+ /**
16
+ * @fileoverview llama.cpp driver: end-of-stream flush for the chunk normalizer.
17
+ * @module @cldmv/llm-translator/driver/llamacpp
18
+ */
19
+ /**
20
+ * Release the content the chunk normalizer was still holding when the stream ended. While it waits to see whether the content opens with
21
+ * `<think>` it holds a partial prefix (`<`, `<thi`) or whitespace; if the stream ends there, that text is the answer and goes out as one
22
+ * more content chunk. Text held inside a repeated think block (`deepseek-legacy`) is the duplicate and is not released.
23
+ * @param {any} ctx - `{ state }`.
24
+ * @returns {any[]} Chunks to emit (empty when nothing is held).
25
+ */
26
+ export function flush(ctx: any): any[];
@@ -0,0 +1,31 @@
1
+ /**
2
+ *
3
+ * @Project: @cldmv/llm-translator
4
+ * @Filename: /src/api/driver/llamacpp/info.mjs
5
+ * @Date: 2026-10-31T14:00:00-07:00 (1793480400)
6
+ * @Author: Nate Corcoran <CLDMV>
7
+ * @Email: <Shinrai@users.noreply.github.com>
8
+ * -----
9
+ * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
+ * @Last modified time: 2026-10-31T14:00:00-07:00 (1793480400)
11
+ * -----
12
+ * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
+ *
14
+ */
15
+ /**
16
+ * @fileoverview llama.cpp driver: static facts about `llama-server`.
17
+ * @module @cldmv/llm-translator/driver/llamacpp
18
+ */
19
+ /**
20
+ * Describe the llama.cpp driver.
21
+ * @returns {{name: string, protocol: string, order: number, auth: string, probes: string[], fields: string[], paths: Record<string,string>}} Driver facts.
22
+ */
23
+ export function info(): {
24
+ name: string;
25
+ protocol: string;
26
+ order: number;
27
+ auth: string;
28
+ probes: string[];
29
+ fields: string[];
30
+ paths: Record<string, string>;
31
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Drop tool fields when there are no tools; send `parallel_tool_calls: true` with tools (llama-server leaves parallel calls off unless
3
+ * asked, and the converter only ever sends `false`); and rename vLLM's `repetition_penalty` to llama.cpp's `repeat_penalty`.
4
+ * @param {any} body - Chat Completions request body.
5
+ * @param {any} [ctx] - `{ settings }`.
6
+ * @returns {any} Normalized body.
7
+ */
8
+ export function request(body: any, ctx?: any): any;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Give tool calls without an id one, and remove the duplicate reasoning that `--reasoning-format deepseek-legacy` leaves in `content`.
3
+ * `deepseek` puts reasoning in `reasoning_content` only; `none` leaves `<think>` tags in `content` only (read by `thinkTags`); `deepseek-legacy`
4
+ * does both, so a leading `<think>...</think>` is cut from `content` when `reasoning_content` already carries the reasoning.
5
+ * @param {any} body - Chat Completions response body.
6
+ * @returns {any} Normalized body.
7
+ */
8
+ export function response(body: any): any;
@@ -0,0 +1,27 @@
1
+ /**
2
+ *
3
+ * @Project: @cldmv/llm-translator
4
+ * @Filename: /src/api/driver/llamacpp/settings.mjs
5
+ * @Date: 2026-10-31T14:00:00-07:00 (1793480400)
6
+ * @Author: Nate Corcoran <CLDMV>
7
+ * @Email: <Shinrai@users.noreply.github.com>
8
+ * -----
9
+ * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
+ * @Last modified time: 2026-10-31T14:00:00-07:00 (1793480400)
11
+ * -----
12
+ * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
+ *
14
+ */
15
+ /**
16
+ * @fileoverview llama.cpp driver: translator settings for `llama-server`.
17
+ * @module @cldmv/llm-translator/driver/llamacpp
18
+ */
19
+ /**
20
+ * Settings for `llama-server`: reasoning comes back as `reasoning_content`, `top_k` is a native sampler, `max_tokens` is the output cap,
21
+ * thinking is toggled through `chat_template_kwargs` (needs `--jinja`) and `images` follows what `/props` says the model accepts.
22
+ * @param {{vision?: boolean}} [facts] - Detection facts.
23
+ * @returns {any} Partial settings.
24
+ */
25
+ export function settings(facts?: {
26
+ vision?: boolean;
27
+ }): any;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Probe an endpoint for Ollama.
3
+ * @param {any} context - `{ endpoint, transport, signal, timeout, probes }`.
4
+ * @returns {Promise<any | null>} Facts `{ version, models }`, or null when the endpoint is not Ollama.
5
+ */
6
+ export function detect(context: any): Promise<any | null>;
@@ -0,0 +1,30 @@
1
+ /**
2
+ *
3
+ * @Project: @cldmv/llm-translator
4
+ * @Filename: /src/api/driver/ollama/info.mjs
5
+ * @Date: 2026-10-31T14:00:00-07:00 (1793480400)
6
+ * @Author: Nate Corcoran <CLDMV>
7
+ * @Email: <Shinrai@users.noreply.github.com>
8
+ * -----
9
+ * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
+ * @Last modified time: 2026-10-31T14:00:00-07:00 (1793480400)
11
+ * -----
12
+ * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
+ *
14
+ */
15
+ /**
16
+ * @fileoverview Ollama driver: static facts about Ollama's OpenAI-compatible `/v1` endpoint.
17
+ * @module @cldmv/llm-translator/driver/ollama
18
+ */
19
+ /**
20
+ * Describe the Ollama driver.
21
+ * @returns {{name: string, protocol: string, order: number, auth: string, probes: string[], paths: Record<string,string>}} Driver facts.
22
+ */
23
+ export function info(): {
24
+ name: string;
25
+ protocol: string;
26
+ order: number;
27
+ auth: string;
28
+ probes: string[];
29
+ paths: Record<string, string>;
30
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Remove `tool_choice`, `n` and `logit_bias` (recorded in `state.dropped`; with `tool_choice: "none"` the tools are removed too, so a forbidden tool call cannot happen), replace images given by URL with a note, and warn once per
3
+ * upstream when the prompt is estimated to exceed `contextWindow` (Ollama truncates silently).
4
+ * @param {any} body - Chat Completions request body.
5
+ * @param {any} [ctx] - `{ endpoint, settings, state, warn }`.
6
+ * @returns {any} Normalized body.
7
+ */
8
+ export function request(body: any, ctx?: any): any;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Settings for Ollama: no `top_k` (not accepted on `/v1`), `max_tokens` as the output cap, no `parallel_tool_calls`, and a
3
+ * `contextWindow` of Ollama's default so a prompt that will be truncated is warned about. Raise `contextWindow` to the value the
4
+ * server really runs with (`OLLAMA_CONTEXT_LENGTH` or a Modelfile `num_ctx`).
5
+ * @returns {any} Partial settings.
6
+ */
7
+ export function settings(): any;
@@ -21,6 +21,6 @@
21
21
  * @param {any} context - `{ endpoint }`.
22
22
  * @returns {{host: string} | null} Facts, or null when the endpoint is not api.openai.com.
23
23
  */
24
- export declare function detect({ endpoint }: any): {
24
+ export function detect({ endpoint }: any): {
25
25
  host: string;
26
26
  } | null;
@@ -20,7 +20,7 @@
20
20
  * Describe the OpenAI driver.
21
21
  * @returns {{name: string, protocol: string, order: number, auth: string, paths: Record<string,string>}} Driver facts.
22
22
  */
23
- export declare function info(): {
23
+ export function info(): {
24
24
  name: string;
25
25
  protocol: string;
26
26
  order: number;
@@ -1,20 +1,6 @@
1
- /**
2
- *
3
- * @Project: @cldmv/llm-translator
4
- * @Filename: /src/api/driver/openai/model/list.mjs
5
- * @Date: 2026-10-25T12:29:36-07:00 (1792956576)
6
- * @Author: Nate Corcoran <CLDMV>
7
- * @Email: <Shinrai@users.noreply.github.com>
8
- * -----
9
- * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
- * @Last modified time: 2026-10-25T12:58:59-07:00 (1792958339)
11
- * -----
12
- * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
- *
14
- */
15
1
  /**
16
2
  * List the models the OpenAI API reports.
17
3
  * @param {any} context - `{ endpoint, transport, signal, timeout }`.
18
4
  * @returns {Promise<any[] | null>} Models, or null when unreachable.
19
5
  */
20
- export declare function list(context: any): Promise<any[] | null>;
6
+ export function list(context: any): Promise<any[] | null>;
@@ -1,20 +1,6 @@
1
- /**
2
- *
3
- * @Project: @cldmv/llm-translator
4
- * @Filename: /src/api/driver/openai/request.mjs
5
- * @Date: 2026-10-25T12:29:36-07:00 (1792956576)
6
- * @Author: Nate Corcoran <CLDMV>
7
- * @Email: <Shinrai@users.noreply.github.com>
8
- * -----
9
- * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
- * @Last modified time: 2026-10-25T12:58:59-07:00 (1792958339)
11
- * -----
12
- * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
- *
14
- */
15
1
  /**
16
2
  * Drop tool fields OpenAI rejects when no tools are present.
17
3
  * @param {any} body - Chat Completions request body.
18
4
  * @returns {any} Normalized body.
19
5
  */
20
- export declare function request(body: any): any;
6
+ export function request(body: any): any;
@@ -20,4 +20,4 @@
20
20
  * Settings for api.openai.com: no `top_k`, `reasoning_effort` for thinking, no prefill continuation.
21
21
  * @returns {any} Partial settings.
22
22
  */
23
- export declare function settings(): any;
23
+ export function settings(): any;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Probe an endpoint for SGLang.
3
+ * @param {any} context - `{ endpoint, transport, signal, timeout, probes }`.
4
+ * @returns {Promise<any | null>} Facts `{ version, models, modelPath, reasoningParser, toolCallParser }`, or null when the endpoint is not SGLang.
5
+ */
6
+ export function detect(context: any): Promise<any | null>;
@@ -0,0 +1,31 @@
1
+ /**
2
+ *
3
+ * @Project: @cldmv/llm-translator
4
+ * @Filename: /src/api/driver/sglang/info.mjs
5
+ * @Date: 2026-10-31T14:00:00-07:00 (1793480400)
6
+ * @Author: Nate Corcoran <CLDMV>
7
+ * @Email: <Shinrai@users.noreply.github.com>
8
+ * -----
9
+ * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
+ * @Last modified time: 2026-10-31T14:00:00-07:00 (1793480400)
11
+ * -----
12
+ * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
+ *
14
+ */
15
+ /**
16
+ * @fileoverview SGLang driver: static facts about the backend.
17
+ * @module @cldmv/llm-translator/driver/sglang
18
+ */
19
+ /**
20
+ * Describe the SGLang driver.
21
+ * @returns {{name: string, protocol: string, order: number, auth: string, probes: string[], fields: string[], paths: Record<string,string>}} Driver facts.
22
+ */
23
+ export function info(): {
24
+ name: string;
25
+ protocol: string;
26
+ order: number;
27
+ auth: string;
28
+ probes: string[];
29
+ fields: string[];
30
+ paths: Record<string, string>;
31
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Drop tool fields when there are no tools, and ask for reasoning to be returned separately (`separate_reasoning: true`) when the server
3
+ * was started with a `--reasoning-parser`. The client's own `separate_reasoning` always wins.
4
+ * @param {any} body - Chat Completions request body.
5
+ * @param {any} [ctx] - `{ endpoint }`.
6
+ * @returns {any} Normalized body.
7
+ */
8
+ export function request(body: any, ctx?: any): any;
@@ -0,0 +1,24 @@
1
+ /**
2
+ *
3
+ * @Project: @cldmv/llm-translator
4
+ * @Filename: /src/api/driver/sglang/settings.mjs
5
+ * @Date: 2026-10-31T14:00:00-07:00 (1793480400)
6
+ * @Author: Nate Corcoran <CLDMV>
7
+ * @Email: <Shinrai@users.noreply.github.com>
8
+ * -----
9
+ * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
+ * @Last modified time: 2026-10-31T14:00:00-07:00 (1793480400)
11
+ * -----
12
+ * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
+ *
14
+ */
15
+ /**
16
+ * @fileoverview SGLang driver: translator settings for SGLang servers.
17
+ * @module @cldmv/llm-translator/driver/sglang
18
+ */
19
+ /**
20
+ * Settings for SGLang: reasoning comes back as `reasoning_content` (with `--reasoning-parser`), `top_k` is a native sampler, thinking is
21
+ * toggled through `chat_template_kwargs`, and the usual OpenAI output cap and usage options apply.
22
+ * @returns {any} Partial settings.
23
+ */
24
+ export function settings(): any;
@@ -1,20 +1,6 @@
1
- /**
2
- *
3
- * @Project: @cldmv/llm-translator
4
- * @Filename: /src/api/driver/vllm/detect.mjs
5
- * @Date: 2026-10-25T12:29:36-07:00 (1792956576)
6
- * @Author: Nate Corcoran <CLDMV>
7
- * @Email: <Shinrai@users.noreply.github.com>
8
- * -----
9
- * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
- * @Last modified time: 2026-10-25T12:59:00-07:00 (1792958340)
11
- * -----
12
- * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
- *
14
- */
15
1
  /**
16
2
  * Probe an endpoint for vLLM.
17
- * @param {any} context - `{ endpoint, transport, signal, timeout }`.
18
- * @returns {Promise<any | null>} Facts `{ version, models, maxModelLen }`, or null when the endpoint is not vLLM.
3
+ * @param {any} context - `{ endpoint, transport, signal, timeout, probes }`.
4
+ * @returns {Promise<any | null>} Facts `{ version, models, maxModelLen }`, or null when the endpoint is not vLLM (or is SGLang or llama.cpp, which also answer `/version`).
19
5
  */
20
- export declare function detect({ endpoint, transport, signal, timeout }: any): Promise<any | null>;
6
+ export function detect({ endpoint, transport, signal, timeout, probes }: any): Promise<any | null>;