Skip to main content

Basic usage

Send a prompt to a model to generate text
import Bytez from 'bytez.js';

// insert your key
const sdk = new Bytez('BYTEZ_KEY');

// choose your model
const model = sdk.model('openai-community/gpt2');

// provide the model with input
const input = "Once upon a time there was a beautiful home where";

// send to the model
const { error, output } = await model.run(input);

// observe the output
console.log({ error, output });

I