Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pricing of models, and include 1106 and 0125 models. #425

Merged
merged 6 commits into from
Feb 17, 2024

Conversation

leobeeson
Copy link
Contributor

@leobeeson leobeeson commented Feb 10, 2024

New OpenAI Pricing

OpenAI updated the pricing of gpt-3.5-turbo-0125 on February 9.

Changes

This commit includes the following changes:

  • Update prices of all models as per OpenAI Pricing page
  • Include gpt-3.5-turbo-0125
  • Include gpt-3.5-turbo-instruct
  • Include gpt-4-0125-preview
  • Include gpt-4-1106-preview
  • Include gpt-4-1106-vision-preview

Ellipsis 🚀 This PR description was created by Ellipsis for commit eae0123.

Summary:

This PR updates the pricing of models and adds new models to the MODEL_COSTS dictionary in instructor/cli/usage.py, and updates the get_model_cost function to handle these new models.

Key points:

  • Updated pricing of models in MODEL_COSTS dictionary in instructor/cli/usage.py.
  • Added new models gpt-3.5-turbo-0125, gpt-3.5-turbo-instruct, gpt-4-0125-preview, gpt-4-1106-preview, and gpt-4-1106-vision-preview to MODEL_COSTS.
  • Updated get_model_cost function to handle new models.

Generated with ❤️ by ellipsis.dev

## New OpenAI Pricing

OpenAI updated the pricing of `gpt-3.5-turbo-0125` on February 9.

## Changes

This commit includes the following changes:

*  Update prices of all models as per [OpenAI Pricing page](https://openai.com/pricing)
* Include `gpt-3.5-turbo-0125`
* Include `gpt-3.5-turbo-instruct`
* Include `gpt-4-0125-preview`
* Include `gpt-4-1106-preview`
* Include `gpt-4-1106-vision-preview`
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. Reviewed entire PR up to commit eae0123

See details

Workflow ID: wflow_Y5HiWW3OoEOW6Qlw

  • Reviewed 42 lines of code across 1 files in 20 second(s).
  • Skipped files: [none]
    • If you think a file was skipped (or not skipped) in error, please contact us.
  • Confidence threshold (set by ellipsis.yaml): 85%
  • Drafted 0 additional comments.

Something look wrong? You can customize Ellipsis by editing the ellipsis.yaml for this repository.

Generated with ❤️ by ellipsis.dev

instructor/cli/usage.py Outdated Show resolved Hide resolved
@jxnl
Copy link
Collaborator

jxnl commented Feb 12, 2024

Are you able to add the new embedding models too? His looks great

@leobeeson
Copy link
Contributor Author

@jxnl Just added the new embedding models too. Thanks.

instructor/cli/usage.py Outdated Show resolved Hide resolved
@leobeeson
Copy link
Contributor Author

@jxnl Done! I put together this simple graph for tracking model alias relationships (and hence pricing), and tracking references, which should facilitate future pricing updates:

Model Literals

{
  "gpt-4-0125-preview": {"points_to": "gpt-4-0125-preview", "price": {"input": "0.01 / 1000", "output": "0.03 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo"]},
  "gpt-4-turbo-preview": {"points_to": "gpt-4-0125-preview", "price": {"input": "0.01 / 1000", "output": "0.03 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo"]},
  "gpt-4-1106-preview": {"points_to": "gpt-4-1106-preview", "price": {"input": "0.01 / 1000", "output": "0.03 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo"]},
  "gpt-4-vision-preview": {"points_to": "gpt-4-vision-preview", "price": {"input": "0.01 / 1000", "output": "0.03 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo"]},
  "gpt-4": {"points_to": "gpt-4-0613", "price": {"input": "0.03 / 1000", "output": "0.06 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo"]},
  "gpt-4-0314": {"points_to": "gpt-4-0314", "price": {"input": "0.03 / 1000", "output": "0.06 / 1000"}, "ref": ["https://platform.openai.com/docs/deprecations/2023-06-13-updated-chat-models"], "legacy_model": true},
  "gpt-4-0613": {"points_to": "gpt-4-0613", "price": {"input": "0.03 / 1000", "output": "0.06 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo"]},
  "gpt-4-32k": {"points_to": "gpt-4-32k-0613", "price": {"input": "0.06 / 1000", "output": "0.12 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo"]},
  "gpt-4-32k-0314": {"points_to": "gpt-4-32k-0314", "price": {"input": "0.06 / 1000", "output": "0.12 / 1000"}, "ref": ["https://platform.openai.com/docs/deprecations/2023-06-13-updated-chat-models"], "legacy_model": true},
  "gpt-4-32k-0613": {"points_to": "gpt-4-32k-0613", "price": {"input": "0.06 / 1000", "output": "0.12 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo"]},
  "gpt-3.5-turbo": {"points_to": "gpt-3.5-turbo-0125", "price": {"input": "0.0005 / 1000", "output": "0.0015 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-3-5-turbo"]}, // "The gpt-3.5-turbo model alias will be automatically upgraded from gpt-3.5-turbo-0613 to gpt-3.5-turbo-0125 on February 16th."
  "gpt-3.5-turbo-16k": {"points_to": "gpt-3.5-turbo-16k-0613", "price": {"input": "0.0030 / 1000", "output": "0.0040 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-3-5-turbo"]},
  "gpt-3.5-turbo-0301": {"points_to": "gpt-3.5-turbo-0301", "price": {"input": "0.0015 / 1000", "output": "0.0020 / 1000"}, "ref": ["https://platform.openai.com/docs/deprecations/2023-06-13-updated-chat-models"]},
  "gpt-3.5-turbo-0613": {"points_to": "gpt-3.5-turbo-0613", "price": {"input": "0.0015 / 1000", "output": "0.0020 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-3-5-turbo"], "legacy_model": true}, // "The gpt-3.5-turbo model alias will be automatically upgraded from gpt-3.5-turbo-0613 to gpt-3.5-turbo-0125 on February 16th."
  "gpt-3.5-turbo-1106": {"points_to": "gpt-3.5-turbo-1106", "price": {"input": "0.0010 / 1000", "output": "0.0020 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-3-5-turbo"]},
  "gpt-3.5-turbo-0125": {"points_to": "gpt-3.5-turbo-0125", "price": {"input": "0.0005 / 1000", "output": "0.0015 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-3-5-turbo"]},
  "gpt-3.5-turbo-16k-0613": {"points_to": "gpt-3.5-turbo-16k-0613", "price": {"input": "0.0030 / 1000", "output": "0.0040 / 1000"}, "ref": ["https://platform.openai.com/docs/deprecations/2023-11-06-chat-model-updates"], "legacy_model": true},
  "gpt-3.5-turbo-instruct": {"points_to": "gpt-3.5-turbo-instruct", "price": {"input": "0.0015 / 1000", "output": "0.0020 / 1000"}, "ref": ["https://platform.openai.com/docs/models/gpt-3-5-turbo"]},
  "text-embedding-3-small": {"price": "0.00002 / 1000"},
  "text-embedding-3-large": {"price": "0.00013 / 1000"},
  "text-embedding-ada-002": {"price": "0.00010 / 1000"},
}

instructor/cli/usage.py Outdated Show resolved Hide resolved
@leobeeson
Copy link
Contributor Author

@jxnl I've reintroduce the behaviour of using a future model version's prefix to match it to it's model family alias. Good catch, thanks.

@jxnl jxnl merged commit 7033488 into instructor-ai:main Feb 17, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants