Skip to content

[Inference providers] Root-only base URLs #1266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2025
Merged
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: 2 additions & 2 deletions packages/inference/src/providers/black-forest-labs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import type { ProviderConfig, UrlParams, HeaderParams, BodyParams } from "../types";

const BLACK_FOREST_LABS_AI_API_BASE_URL = "https://api.us1.bfl.ai/v1";
const BLACK_FOREST_LABS_AI_API_BASE_URL = "https://api.us1.bfl.ai";

const makeBody = (params: BodyParams): Record<string, unknown> => {
return params.args;
Expand All @@ -31,7 +31,7 @@ const makeHeaders = (params: HeaderParams): Record<string, string> => {
};

const makeUrl = (params: UrlParams): string => {
return `${params.baseUrl}/${params.model}`;
return `${params.baseUrl}/v1/${params.model}`;
};

export const BLACK_FOREST_LABS_CONFIG: ProviderConfig = {
Expand Down
6 changes: 3 additions & 3 deletions packages/inference/src/providers/fireworks-ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import type { ProviderConfig, UrlParams, HeaderParams, BodyParams } from "../types";

const FIREWORKS_AI_API_BASE_URL = "https://api.fireworks.ai/inference";
const FIREWORKS_AI_API_BASE_URL = "https://api.fireworks.ai";

const makeBody = (params: BodyParams): Record<string, unknown> => {
return {
Expand All @@ -31,9 +31,9 @@ const makeHeaders = (params: HeaderParams): Record<string, string> => {

const makeUrl = (params: UrlParams): string => {
if (params.task === "text-generation" && params.chatCompletion) {
return `${params.baseUrl}/v1/chat/completions`;
return `${params.baseUrl}/inference/v1/chat/completions`;
}
return params.baseUrl;
return `${params.baseUrl}/inference`;
};

export const FIREWORKS_AI_CONFIG: ProviderConfig = {
Expand Down