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
2 changes: 2 additions & 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:
- [Fireworks AI](https://fireworks.ai)
- [HF Inference](https://huggingface.co/docs/inference-providers/providers/hf-inference)
- [Hyperbolic](https://hyperbolic.xyz)
- [Mokzu](https://mokzu.com)
- [Nebius](https://studio.nebius.ai)
- [Novita](https://novita.ai)
- [Nscale](https://nscale.com)
Expand Down Expand Up @@ -93,6 +94,7 @@ Only a subset of models are supported when requesting third-party providers. You
- [Fireworks AI supported models](https://huggingface.co/api/partners/fireworks-ai/models)
- [HF Inference supported models](https://huggingface.co/api/partners/hf-inference/models)
- [Hyperbolic supported models](https://huggingface.co/api/partners/hyperbolic/models)
- [Mokzu supported models](https://huggingface.co/api/partners/mokzu/models)
- [Nebius supported models](https://huggingface.co/api/partners/nebius/models)
- [Nscale supported models](https://huggingface.co/api/partners/nscale/models)
- [OVHcloud supported models](https://huggingface.co/api/partners/ovhcloud/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 @@ -9,6 +9,7 @@ import * as Fireworks from "../providers/fireworks-ai.js";
import * as Groq from "../providers/groq.js";
import * as HFInference from "../providers/hf-inference.js";
import * as Hyperbolic from "../providers/hyperbolic.js";
import * as Mokzu from "../providers/mokzu.js";
import * as Nebius from "../providers/nebius.js";
import * as Novita from "../providers/novita.js";
import * as Nscale from "../providers/nscale.js";
Expand Down Expand Up @@ -130,6 +131,9 @@ export const PROVIDERS: Record<InferenceProvider, Partial<Record<InferenceTask,
conversational: new Hyperbolic.HyperbolicConversationalTask(),
"text-generation": new Hyperbolic.HyperbolicTextGenerationTask(),
},
mokzu: {
"image-to-video": new Mokzu.MokzuImageToVideoTask(),
},
nebius: {
"text-to-image": new Nebius.NebiusTextToImageTask(),
conversational: new Nebius.NebiusConversationalTask(),
Expand Down
34 changes: 34 additions & 0 deletions packages/inference/src/providers/mokzu.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { TaskProviderHelper } from "./providerHelper";

export class MokzuImageToVideoTask extends TaskProviderHelper {
constructor() {
super("mokzu", "https://api.mokzu.com", "image-to-video");
}

makeRoute(params: any) {
return "/v1/image-to-video";
}

preparePayload(params: any) {
const payload: any = {
image: params.image, // base64 encoded image
prompt: params.prompt || "",
};

if (params.duration !== undefined) {
payload.duration = params.duration;
}
if (params.instruction !== undefined) {
payload.instruction = params.instruction;
}

return payload;
}

getResponse(response: any) {
if (!response.video_url) {
throw new Error("No video_url in response");
}
return response.video_url;
}
}
2 changes: 2 additions & 0 deletions packages/inference/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const INFERENCE_PROVIDERS = [
"groq",
"hf-inference",
"hyperbolic",
"mokzu",
"nebius",
"novita",
"nscale",
Expand Down Expand Up @@ -93,6 +94,7 @@ export const PROVIDERS_HUB_ORGS: Record<InferenceProvider, string> = {
groq: "groq",
"hf-inference": "hf-inference",
hyperbolic: "Hyperbolic",
mokzu: "mokzu",
nebius: "nebius",
novita: "novita",
nscale: "nscale",
Expand Down