Add cost estimation for use of closed source models - #15
Conversation
There was a problem hiding this comment.
LGTM 👍
I think one interesting result is that it will cost at the very least 60$ for one run. The good thing is that it's acceptable and manageable but we probably won't be able to run our pipeline again and again carelessely. The other result is that larger models like gpt-4o or sonnet-3.5 are probably too expensive for this scale.
Maybe we can rerun this later when we'll have the final dataset and prompts to have a more accurate cost estimation before running it on the entire data history.
There was a problem hiding this comment.
prompt_cost = prompt_tokens * prices['input'] * prices['cache_discount'] / 1e6
The caching is only possible starting from 1024/2048 tokens, see OpenAI & Anthropic docs so it's a bit optimistic with this prompt that contains only 636 tokens. Maybe we'll include few shots & more and eventually reach this limit though. I guess if we use structured outputs that counts as extra tokens too. But this is really a detail 😛, I just wasn't sure if you were aware of this lower limit of 1024/2048.
Work done
Very simple analysis:
Results: it could cost as little as $60, and a few hundreds USD for more output tokens (max is $600 for 1000 ot using Claude).
Related issue: #11