Upgrading from @octoai/client

Migrating to the new SDK package

$npm uninstall @octoai/client
>npm install @octoai/sdk

Upgrading your code

The various OctoAI APIs are now accessible from a single client:

TypeScript
1import { OctoAIClient } from "@octoai/sdk";
2
3const octoai = new OctoAIClient({
4 apiKey: process.env.OCTOAI_TOKEN,
5});
6
7// The various APIs are now accessible from the client
8octoai.textGen;
9octoai.imageGen;
10octoai.fineTuning;
11octoai.assetLibrary;

Image Generation API changes

In the octoai.imageGen API, instead of specifying which engine to use, use the corresponding generate* method such as generateSdxl() or generateSd().

Text Generation API changes

The text generation models with octoai.textGen API are now specified with a string model name instead of an enum.

Streaming requests are made with the corresponding octoai.textGen.*Stream method such as createCompletionStream() or createChatCompletionStream().

Asset Library (Asset Orchestrator) API changes

The Asset Orchestrator has been renamed to Asset Library and can be accessed via octoai.assetLibrary. Assets can be created with the octoai.assetLibrary.upload() method.

Compute Inferencing API changes

The infer() method is not available in this SDK. You will need to continue to use the older @octoai/client for full inferencing support.