@commonbase/sdk
v0.15.2
Published
Commonbase is a Typescript SDK for building LLM integrations and tooling
Downloads
109
Readme
Commonbase Typescript SDK for building LLM integrations faster and easier
Commonbase allows developers to integrate with any popular LLM API provider without needing to change any code. The SDK helps with collecting data and feedback from the users and helps you fine-tune models for your specific use case.
Installation
Install Commonbase from npm using your preferred package manager:
npm add @commonbase/sdk
pnpm add @commonbase/sdk
yarn add @commonbase/sdk
Usage
A Project ID and API Key are required for all Commonbase requests. You can find your project ID and generate an API key in the Commonbase Dashboard.
To create a completion, configure a Client
with your API Key and provide your
Project ID and prompt to createCompletion
.
import { Client } from "@commonbase/sdk";
const client = new Client({
apiKey: "API_KEY",
});
const completion = await client.createCompletion({
projectId: "PROJECT_ID",
prompt: "Hello",
});
console.log(completion.bestChoice.text);
To stream a completion as it is generated, use streamChatCompletion
.
For more examples, see /examples.