Live data from Hacker News

Show HN: Token price calculator for 400+ LLMs

github.com

41–50 of 79 posts

Re: Show HN: Token price calculator for 400+ LLMs

#41
post #15

Earlier quoted context omitted.

"This package can be used to count tokens for Anthropic's older models. As of the Claude 3 models, this algorithm is no longer accurate [...]" I've been bugging Anthropic about this for a while, they said that releasing a new tokenizer is not on their current roadmap.

Imagine a coffee shop refusing to have a price list until after the coffee's been made.

reminds me of the coffee shop incident in seattle last week with the hammer

Re: Show HN: Token price calculator for 400+ LLMs

#42
post #11

With all the options there seems like an opportunity for a single point API that can take a series of prompts, a budget and a quality hint to distribute batches for most bang for buck. Maybe a small triage AI to decide how effectively models handle certain prompts to preserve spending for the difficult tasks. Does anything like this exist yet?

That's openrouter, they are listed

Re: Show HN: Token price calculator for 400+ LLMs

#43
post #11

With all the options there seems like an opportunity for a single point API that can take a series of prompts, a budget and a quality hint to distribute batches for most bang for buck. Maybe a small triage AI to decide how effectively models handle certain prompts to preserve spending for the difficult tasks. Does anything like this exist yet?

Generally, if you've got a task big enough that you're worried about pricing, it's probably going to involve thousands of API calls.

In that case you might as well make ~20 API calls to each LLM under consideration, and evaluate the results yourself.

It's far easier to evaluate a model's performance on a given prompt by looking at the output than by looking at the input alone.

Re: Show HN: Token price calculator for 400+ LLMs

#44

Earlier quoted context omitted.

Imagine a coffee shop refusing to have a price list until after the coffee's been made.

In many countries a taxi won't tell you how much the ride will cost. The first time I traveled to somewhere that negotiated the cost up front it blew my mind. Frequently, contracts will have room for additional charges if circumstances change even a little, or products will have a market rate (fish, equity, etc.). It might seem absurd but variable cost things are not uncommon.

> In many countries a taxi won't tell you how much the ride will cost.

I've only ever seen: fixed price based on destination (typically for fares originating from an airport), negotiated, or metered. A better analog analogy would be metered pricing, but where the cost per mile is a secret.

Re: Show HN: Token price calculator for 400+ LLMs

#46

What a nice product! I think the way to count tokens depends on the language, but is this only supported in English?

Most LLMs determine their token inventories by using byte-pair encoding, which algorithmically induces sub-word tokens from a body of text. So even in English you might see a word like "proselytization" tokenized apart into "_pro", "selyt", "iz", "ation", and non-English languages will probably (depending on their proportional representation in the training corpus) also receive token allocations in the BPE vocabulary.

Here's actual output from the GPT-4o tokenizer for English and Hindi:

    >>> [enc.decode([x]) for x in enc.encode("proselytization")]
    ['pros', 'ely', 't', 'ization']
    >>> [enc.decode([x]) for x in enc.encode("पर्यावरणवाद")]
    ['पर', '्य', 'ावरण', 'वाद']

Re: Show HN: Token price calculator for 400+ LLMs

#47
post #24

Earlier quoted context omitted.

$/million tokens is the standard pricing metric.

standard ≠ good

"Standard" doesn't imply "good", but that doesn't mean "non-standard" is better. Cost-per-quantity (L/100km) is easier to compare than quantity-per-cost (MPG) because how much you use isn't going to change based on the model. Which is to say, if two local models are both $0.00 per million tokens, they effectively have the same cost. You could argue that you might get better results by throwing out more tokens, but the solution is to add more significant digits to the price per unit.

Re: Show HN: Token price calculator for 400+ LLMs

#48
post #15

Earlier quoted context omitted.

"This package can be used to count tokens for Anthropic's older models. As of the Claude 3 models, this algorithm is no longer accurate [...]" I've been bugging Anthropic about this for a while, they said that releasing a new tokenizer is not on their current roadmap.

Imagine a coffee shop refusing to have a price list until after the coffee's been made.

I mean you already pay per output token and (sure, you can limit it), but it's unpredictable given the prompt?

Re: Show HN: Token price calculator for 400+ LLMs

#49
An interesting parameter that I don't read about a lot is vocab size. A larger vocab means you will need to generate less tokens for the same word on average, also the context window will be larger. This means that a model with a large vocab might be more expensive on a per token basis, but would generate less tokens for the same sentence, making it cheaper overall. This should be taken into consideration when comparing API prices.
Post reply on HN