Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
HF_SAMBANOVA_KEY: dummy
HF_TOGETHER_KEY: dummy
HF_FIREWORKS_KEY: dummy
HF_BLACKFORESTLABS_KEY: dummy

browser:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -87,6 +88,7 @@ jobs:
HF_SAMBANOVA_KEY: dummy
HF_TOGETHER_KEY: dummy
HF_FIREWORKS_KEY: dummy
HF_BLACKFORESTLABS_KEY: dummy

e2e:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -155,3 +157,4 @@ jobs:
HF_SAMBANOVA_KEY: dummy
HF_TOGETHER_KEY: dummy
HF_FIREWORKS_KEY: dummy
HF_BLACKFORESTLABS_KEY: dummy
1 change: 1 addition & 0 deletions packages/inference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Currently, we support the following providers:
- [Replicate](https://replicate.com)
- [Sambanova](https://sambanova.ai)
- [Together](https://together.xyz)
- [Blackforestlabs](https://blackforestlabs.ai)

To send requests to a third-party provider, you have to pass the `provider` parameter to the inference function. Make sure your request is authenticated with an access token.
```ts
Expand Down
1 change: 1 addition & 0 deletions packages/inference/src/lib/makeRequestOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { REPLICATE_API_BASE_URL } from "../providers/replicate";
import { SAMBANOVA_API_BASE_URL } from "../providers/sambanova";
import { TOGETHER_API_BASE_URL } from "../providers/together";
import { FIREWORKS_AI_API_BASE_URL } from "../providers/fireworks-ai";
import { BLACKFORESTLABS_AI_API_BASE_URL } from "../providers/blackforestlabs-ai";
import type { InferenceProvider } from "../types";
import type { InferenceTask, Options, RequestArgs } from "../types";
import { isUrl } from "./isUrl";
Expand Down
18 changes: 18 additions & 0 deletions packages/inference/src/providers/blackforestlabs-ai.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export const BLACKFORESTLABS_AI_API_BASE_URL = "https://api.us1.bfl.ai/v1/";

/**
* See the registered mapping of HF model ID => Black Forest Labs model ID here:
*
* https://huggingface.co/api/partners/blackforestlabs/models
*
* This is a publicly available mapping.
*
* If you want to try to run inference for a new model locally before it's registered on huggingface.co,
* you can add it to the dictionary "HARDCODED_MODEL_ID_MAPPING" in consts.ts, for dev purposes.
*
* - If you work at Black Forest Labs and want to update this mapping, please use the model mapping API we provide on huggingface.co
* - If you're a community member and want to add a new supported HF model to Black Forest Labs, please open an issue on the present repo
* and we will tag Black Forest Labs team members.
*
* Thanks!
*/
1 change: 1 addition & 0 deletions packages/inference/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const INFERENCE_PROVIDERS = [
"replicate",
"sambanova",
"together",
"blackforestlabs-ai",
] as const;
export type InferenceProvider = (typeof INFERENCE_PROVIDERS)[number];

Expand Down