Basic usage
Basic usage
Send a prompt to a model to generate text
Copy
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('google/flan-t5-base');
// provide the model with input
const input = "Once upon a time there was a beautiful home where";
// provide the model with params
const params = {
"max_new_tokens": 200,
"min_new_tokens": 50,
"temperature": 0.5
};
// send to the model
const { error, output } = await model.run(input, params);
// observe the output
console.log({ error, output });