@staticeng/opencode-litellm 0.1.4 → 0.1.6
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/dist/helpers.d.ts +4 -0
- package/dist/helpers.js +3 -0
- package/dist/index.d.ts +1 -5
- package/dist/index.js +1 -4
- package/dist/mapping.js +6 -1
- package/package.json +5 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { buildProvider, buildProviderV2, mapModels, mapModelsV2 } from "./mapping.js";
|
|
2
|
+
export { fetchModelInfo } from "./litellm.js";
|
|
3
|
+
export { deepMerge } from "./merge.js";
|
|
4
|
+
export type { LiteLLMModelInfo, LiteLLMPluginOptions, OpenCodeModel, OpenCodeModelV2, OpenCodeProvider, OpenCodeProviderV2, } from "./types.js";
|
package/dist/helpers.js
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { Config, PluginInput } from "@opencode-ai/plugin";
|
|
2
2
|
import type { LiteLLMPluginOptions } from "./types.js";
|
|
3
|
-
|
|
3
|
+
declare const LiteLLMPlugin: (ctx: PluginInput, options?: LiteLLMPluginOptions) => Promise<{
|
|
4
4
|
config: (cfg: Config) => Promise<void>;
|
|
5
5
|
}>;
|
|
6
6
|
export default LiteLLMPlugin;
|
|
7
|
-
export { buildProvider, buildProviderV2, mapModels, mapModelsV2 } from "./mapping.js";
|
|
8
|
-
export { fetchModelInfo } from "./litellm.js";
|
|
9
|
-
export { deepMerge } from "./merge.js";
|
|
10
|
-
export type { LiteLLMPluginOptions, LiteLLMModelInfo, OpenCodeProvider, OpenCodeModel } from "./types.js";
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { resolveOptions } from "./options.js";
|
|
|
4
4
|
async function log(ctx, level, message, extra = {}) {
|
|
5
5
|
await ctx.client?.app?.log?.({ body: { service: "opencode-litellm", level, message, extra } });
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
const LiteLLMPlugin = async (ctx, options) => {
|
|
8
8
|
const resolved = resolveOptions(options);
|
|
9
9
|
return {
|
|
10
10
|
config: async (cfg) => {
|
|
@@ -39,6 +39,3 @@ export const LiteLLMPlugin = async (ctx, options) => {
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
export default LiteLLMPlugin;
|
|
42
|
-
export { buildProvider, buildProviderV2, mapModels, mapModelsV2 } from "./mapping.js";
|
|
43
|
-
export { fetchModelInfo } from "./litellm.js";
|
|
44
|
-
export { deepMerge } from "./merge.js";
|
package/dist/mapping.js
CHANGED
|
@@ -136,6 +136,10 @@ function v2Variants(model) {
|
|
|
136
136
|
const body = raw.options && typeof raw.options === "object" && !Array.isArray(raw.options)
|
|
137
137
|
? raw.options
|
|
138
138
|
: raw;
|
|
139
|
+
if (body.reasoningEffort !== undefined && body.reasoning_effort === undefined) {
|
|
140
|
+
body.reasoning_effort = body.reasoningEffort;
|
|
141
|
+
delete body.reasoningEffort;
|
|
142
|
+
}
|
|
139
143
|
return { id, body };
|
|
140
144
|
});
|
|
141
145
|
}
|
|
@@ -178,10 +182,11 @@ export function buildProvider(models, options = {}) {
|
|
|
178
182
|
id: options.providerKey ?? "LiteLLM",
|
|
179
183
|
name: options.providerName ?? "LiteLLM",
|
|
180
184
|
npm: "@ai-sdk/openai-compatible",
|
|
181
|
-
api:
|
|
185
|
+
api: options.baseURL,
|
|
182
186
|
options: {
|
|
183
187
|
baseURL: options.baseURL,
|
|
184
188
|
apiKey: options.apiKey,
|
|
189
|
+
...(options.apiKey ? { body: { apiKey: options.apiKey } } : {}),
|
|
185
190
|
},
|
|
186
191
|
models: mapModels(models, options),
|
|
187
192
|
}, options.providerOverrides);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@staticeng/opencode-litellm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "OpenCode plugin that discovers LiteLLM models at runtime.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./helpers": {
|
|
15
|
+
"types": "./dist/helpers.d.ts",
|
|
16
|
+
"import": "./dist/helpers.js"
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
19
|
"files": [
|