Estimate price
estimate_price(token_count, model_name='gpt-3.5-turbo')
Estimate the price for the token count, for different models.
Current, we will use the gpt to extract layout and content structure from the document.
So roughly input and output tokens are the same So we will have (input price + output price) * token_count * call_it_twice
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token_count |
int
|
Number of tokens |
required |
model_name |
str
|
Model name to estimate the price Choices: "gpt-3.5-turbo", "gpt-4o", "gpt-4-turbo" |
'gpt-3.5-turbo'
|
Returns:
Name | Type | Description |
---|---|---|
price_in_usd |
float
|
Price in USD |
- Model: gpt-3.5-turbo => Price US$0.50 / 1M tokens (Input), US1.50 / 1M tokens (Output)
Source code in Docs2KG/utils/llm/estimate_price.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|