UNPKG

@light-merlin-dark/tok

Version:

Fast token estimation and cost calculation for enterprise LLMs with CLI and MCP support

16 lines 512 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CostCalculator = void 0; class CostCalculator { static cost(tokens, dollarsPerMillion) { return (tokens / 1_000_000) * dollarsPerMillion; } static formatCost(cost) { return `$${cost.toFixed(4)}`; } static tokensPerDollar(dollarsPerMillion) { return Math.floor(1_000_000 / dollarsPerMillion); } } exports.CostCalculator = CostCalculator; //# sourceMappingURL=CostCalculator.js.map