Skip to content
ml0x-comPublic

About

Compute per-call and monthly LLM API cost from token counts and per-million-token pricing

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llmcost

Compute per-call and monthly cost of an LLM API from token counts and per-million-token pricing — the arithmetic behind any LLM pricing calculator. Holds no price table of its own, because published per-model prices change and a library that hardcodes them goes stale.

A worked table of per-model conversation costs is at KickLLM's chatbot cost breakdown.

Usage

import llmcost;

const auto perCall = callCost(2000, 500, 3.0, 15.0);       // $/call
const auto perMonth = monthlyCost(1000, 2000, 500, 3.0, 15.0); // $/month, 1,000 convos

License: MIT

About

Compute per-call and monthly LLM API cost from token counts and per-million-token pricing

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages