Skip to content

Commit e4acc20

Browse files
committed
First commit
1 parent c1a8dfc commit e4acc20

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
HF_SAMBANOVA_KEY: dummy
4747
HF_TOGETHER_KEY: dummy
4848
HF_FIREWORKS_KEY: dummy
49+
HF_BLACKFORESTLABS_KEY: dummy
4950

5051
browser:
5152
runs-on: ubuntu-latest
@@ -87,6 +88,7 @@ jobs:
8788
HF_SAMBANOVA_KEY: dummy
8889
HF_TOGETHER_KEY: dummy
8990
HF_FIREWORKS_KEY: dummy
91+
HF_BLACKFORESTLABS_KEY: dummy
9092

9193
e2e:
9294
runs-on: ubuntu-latest
@@ -155,3 +157,4 @@ jobs:
155157
HF_SAMBANOVA_KEY: dummy
156158
HF_TOGETHER_KEY: dummy
157159
HF_FIREWORKS_KEY: dummy
160+
HF_BLACKFORESTLABS_KEY: dummy

packages/inference/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Currently, we support the following providers:
5252
- [Replicate](https://replicate.com)
5353
- [Sambanova](https://sambanova.ai)
5454
- [Together](https://together.xyz)
55+
- [Blackforestlabs](https://blackforestlabs.ai)
5556

5657
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.
5758
```ts

packages/inference/src/lib/makeRequestOptions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { REPLICATE_API_BASE_URL } from "../providers/replicate";
44
import { SAMBANOVA_API_BASE_URL } from "../providers/sambanova";
55
import { TOGETHER_API_BASE_URL } from "../providers/together";
66
import { FIREWORKS_AI_API_BASE_URL } from "../providers/fireworks-ai";
7+
import { BLACKFORESTLABS_AI_API_BASE_URL } from "../providers/blackforestlabs-ai";
78
import type { InferenceProvider } from "../types";
89
import type { InferenceTask, Options, RequestArgs } from "../types";
910
import { isUrl } from "./isUrl";
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export const BLACKFORESTLABS_AI_API_BASE_URL = "https://api.us1.bfl.ai/v1/";
2+
3+
/**
4+
* See the registered mapping of HF model ID => Black Forest Labs model ID here:
5+
*
6+
* https://huggingface.co/api/partners/blackforestlabs/models
7+
*
8+
* This is a publicly available mapping.
9+
*
10+
* If you want to try to run inference for a new model locally before it's registered on huggingface.co,
11+
* you can add it to the dictionary "HARDCODED_MODEL_ID_MAPPING" in consts.ts, for dev purposes.
12+
*
13+
* - If you work at Black Forest Labs and want to update this mapping, please use the model mapping API we provide on huggingface.co
14+
* - 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
15+
* and we will tag Black Forest Labs team members.
16+
*
17+
* Thanks!
18+
*/

packages/inference/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const INFERENCE_PROVIDERS = [
5151
"replicate",
5252
"sambanova",
5353
"together",
54+
"blackforestlabs-ai",
5455
] as const;
5556
export type InferenceProvider = (typeof INFERENCE_PROVIDERS)[number];
5657

0 commit comments

Comments
 (0)