@blaxel/llamaindex 0.2.65-dev.77 → 0.2.65-preview.78
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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/model.js +16 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/model.js +16 -0
- package/package.json +2 -2
package/dist/cjs/model.js
CHANGED
|
@@ -94,6 +94,22 @@ class BlaxelLLM {
|
|
|
94
94
|
headers,
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
|
+
// mk3 models use the direct gateway URL and always speak OpenAI-compatible API
|
|
98
|
+
if (this.modelData?.spec.runtime?.generation === "mk3") {
|
|
99
|
+
const gatewayUrl = this.modelData.metadata.url;
|
|
100
|
+
if (!gatewayUrl) {
|
|
101
|
+
throw new Error(`Model ${this.model} is mk3 but has no gateway URL in metadata`);
|
|
102
|
+
}
|
|
103
|
+
return (0, openai_1.openai)({
|
|
104
|
+
model: this.model,
|
|
105
|
+
apiKey: currentToken,
|
|
106
|
+
baseURL: `${gatewayUrl}/v1`,
|
|
107
|
+
additionalSessionOptions: {
|
|
108
|
+
fetch: authenticatedFetch,
|
|
109
|
+
},
|
|
110
|
+
...this.options,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
97
113
|
if (this.type === "mistral") {
|
|
98
114
|
return (0, openai_1.openai)({
|
|
99
115
|
model: this.modelData?.spec.runtime?.model,
|