Skip to content
Draft
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
2 changes: 2 additions & 0 deletions packages/inference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Currently, we support the following providers:
- [Nscale](https://nscale.com)
- [NVIDIA](https://build.nvidia.com/)
- [OVHcloud](https://endpoints.ai.cloud.ovh.net/)
- [Phala](https://phala.com)
- [Public AI](https://publicai.co)
- [Replicate](https://replicate.com)
- [Sambanova](https://sambanova.ai)
Expand Down Expand Up @@ -99,6 +100,7 @@ Only a subset of models are supported when requesting third-party providers. You
- [Nscale supported models](https://huggingface.co/api/partners/nscale/models)
- [NVIDIA supported models](https://huggingface.co/api/partners/nvidia/models)
- [OVHcloud supported models](https://huggingface.co/api/partners/ovhcloud/models)
- [Phala supported models](https://huggingface.co/api/partners/phala/models)
- [Replicate supported models](https://huggingface.co/api/partners/replicate/models)
- [Sambanova supported models](https://huggingface.co/api/partners/sambanova/models)
- [Scaleway supported models](https://huggingface.co/api/partners/scaleway/models)
Expand Down
4 changes: 4 additions & 0 deletions packages/inference/src/lib/getProviderHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import * as Nscale from "../providers/nscale.js";
import * as Nvidia from "../providers/nvidia.js";
import * as OpenAI from "../providers/openai.js";
import * as OvhCloud from "../providers/ovhcloud.js";
import * as Phala from "../providers/phala.js";
import * as PublicAI from "../providers/publicai.js";
import type {
AudioClassificationTaskHelper,
Expand Down Expand Up @@ -163,6 +164,9 @@ export const PROVIDERS: Record<InferenceProvider, Partial<Record<InferenceTask,
conversational: new OvhCloud.OvhCloudConversationalTask(),
"text-generation": new OvhCloud.OvhCloudTextGenerationTask(),
},
phala: {
conversational: new Phala.PhalaConversationalTask(),
},
publicai: {
conversational: new PublicAI.PublicAIConversationalTask(),
},
Expand Down
1 change: 1 addition & 0 deletions packages/inference/src/providers/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const HARDCODED_MODEL_INFERENCE_MAPPING: Record<
openai: {},
publicai: {},
ovhcloud: {},
phala: {},
replicate: {},
sambanova: {},
scaleway: {},
Expand Down
24 changes: 24 additions & 0 deletions packages/inference/src/providers/phala.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* See the registered mapping of HF model ID => Phala model ID here:
*
* https://huggingface.co/api/partners/phala/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 Phala 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 Phala, please open an issue on the present repo
* and we will tag Phala team members.
*
* Thanks!
*/

import { BaseConversationalTask } from "./providerHelper.js";

export class PhalaConversationalTask extends BaseConversationalTask {
constructor() {
super("phala", "https://api.redpill.ai");
}
}
2 changes: 2 additions & 0 deletions packages/inference/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const INFERENCE_PROVIDERS = [
"nvidia",
"openai",
"ovhcloud",
"phala",
"publicai",
"replicate",
"sambanova",
Expand Down Expand Up @@ -102,6 +103,7 @@ export const PROVIDERS_HUB_ORGS: Record<InferenceProvider, string> = {
nvidia: "nvidia",
openai: "openai",
ovhcloud: "ovhcloud",
phala: "PhalaCloud",
publicai: "publicai",
replicate: "replicate",
sambanova: "sambanovasystems",
Expand Down