@pezzo/llm-toolkit
TypeScript icon, indicating that this package has built-in type declarations

0.7.0 • Public • Published

@pezzo/llm-toolkit

LLM Toolkit is a collection of llm providers and utilities.

Installation

npm install @pezzo/llm-toolkit

Usage

import { OpenAIToolkit } from "@pezzo/llm-toolkit";

Get model pricing

const { promptCostPer1000Tokens, completionCostPer1000Tokens } =
  OpenAIToolkit.gptModels["gpt-3.5-turbo"];

Calculate cost of a prompt

// the modelName parameter is fully typed, you'll be able to see a a list with the available models

const cost = OpenAIToolkit.calculateGptCost(
  promptTokens,
  completionTokens,
  modelName
);

Note: The model name is fully typed, you'll be able to see a list with the available models. Example

Available Providers

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i @pezzo/llm-toolkit

    Weekly Downloads

    18

    Version

    0.7.0

    License

    MIT

    Unpacked Size

    50.8 kB

    Total Files

    16

    Last publish

    Collaborators

    • arielweinberger