Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions @blaxel/core/src/common/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ class Settings {
return false;
}

get modelGatewayUrl() {
return env.BL_MODEL_GATEWAY_URL || undefined;
}

get region() {
return env.BL_REGION || undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion @blaxel/langgraph/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const blModel = async (

// mk3 models use the direct gateway URL and always speak OpenAI-compatible API
if (modelData.spec.runtime?.generation === "mk3") {
const gatewayUrl = modelData.metadata.url;
const gatewayUrl = settings.modelGatewayUrl || modelData.metadata.url;
if (!gatewayUrl) {
throw new Error(`Model ${model} is mk3 but has no gateway URL in metadata`);
}
Expand Down
2 changes: 1 addition & 1 deletion @blaxel/llamaindex/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class BlaxelLLM implements ToolCallLLM<object, ToolCallLLMMessageOptions> {

// mk3 models use the direct gateway URL and always speak OpenAI-compatible API
if (this.modelData?.spec.runtime?.generation === "mk3") {
const gatewayUrl = this.modelData.metadata.url;
const gatewayUrl = settings.modelGatewayUrl || this.modelData.metadata.url;
if (!gatewayUrl) {
throw new Error(`Model ${this.model} is mk3 but has no gateway URL in metadata`);
}
Expand Down
2 changes: 1 addition & 1 deletion @blaxel/vercel/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const blModel = async (

// mk3 models use the direct gateway URL and always speak OpenAI-compatible API
if (modelData.spec.runtime?.generation === "mk3") {
const gatewayUrl = modelData.metadata.url;
const gatewayUrl = settings.modelGatewayUrl || modelData.metadata.url;
if (!gatewayUrl) {
throw new Error(`Model ${model} is mk3 but has no gateway URL in metadata`);
}
Expand Down
Loading