0.7.0 • Published 1 year ago

@pezzo/llm-toolkit v0.7.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@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

0.7.0

1 year ago

0.6.0

1 year ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago