llm_constant.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. from _decimal import Decimal
  2. models = {
  3. 'gpt-4': 'openai', # 8,192 tokens
  4. 'gpt-4-32k': 'openai', # 32,768 tokens
  5. 'gpt-3.5-turbo': 'openai', # 4,096 tokens
  6. 'text-davinci-003': 'openai', # 4,097 tokens
  7. 'text-davinci-002': 'openai', # 4,097 tokens
  8. 'text-curie-001': 'openai', # 2,049 tokens
  9. 'text-babbage-001': 'openai', # 2,049 tokens
  10. 'text-ada-001': 'openai', # 2,049 tokens
  11. 'text-embedding-ada-002': 'openai' # 8191 tokens, 1536 dimensions
  12. }
  13. max_context_token_length = {
  14. 'gpt-4': 8192,
  15. 'gpt-4-32k': 32768,
  16. 'gpt-3.5-turbo': 4096,
  17. 'text-davinci-003': 4097,
  18. 'text-davinci-002': 4097,
  19. 'text-curie-001': 2049,
  20. 'text-babbage-001': 2049,
  21. 'text-ada-001': 2049,
  22. 'text-embedding-ada-002': 8191
  23. }
  24. models_by_mode = {
  25. 'chat': [
  26. 'gpt-4', # 8,192 tokens
  27. 'gpt-4-32k', # 32,768 tokens
  28. 'gpt-3.5-turbo', # 4,096 tokens
  29. ],
  30. 'completion': [
  31. 'gpt-4', # 8,192 tokens
  32. 'gpt-4-32k', # 32,768 tokens
  33. 'gpt-3.5-turbo', # 4,096 tokens
  34. 'text-davinci-003', # 4,097 tokens
  35. 'text-davinci-002' # 4,097 tokens
  36. 'text-curie-001', # 2,049 tokens
  37. 'text-babbage-001', # 2,049 tokens
  38. 'text-ada-001' # 2,049 tokens
  39. ],
  40. 'embedding': [
  41. 'text-embedding-ada-002' # 8191 tokens, 1536 dimensions
  42. ]
  43. }
  44. model_currency = 'USD'
  45. model_prices = {
  46. 'gpt-4': {
  47. 'prompt': Decimal('0.03'),
  48. 'completion': Decimal('0.06'),
  49. },
  50. 'gpt-4-32k': {
  51. 'prompt': Decimal('0.06'),
  52. 'completion': Decimal('0.12')
  53. },
  54. 'gpt-3.5-turbo': {
  55. 'prompt': Decimal('0.002'),
  56. 'completion': Decimal('0.002')
  57. },
  58. 'text-davinci-003': {
  59. 'prompt': Decimal('0.02'),
  60. 'completion': Decimal('0.02')
  61. },
  62. 'text-curie-001': {
  63. 'prompt': Decimal('0.002'),
  64. 'completion': Decimal('0.002')
  65. },
  66. 'text-babbage-001': {
  67. 'prompt': Decimal('0.0005'),
  68. 'completion': Decimal('0.0005')
  69. },
  70. 'text-ada-001': {
  71. 'prompt': Decimal('0.0004'),
  72. 'completion': Decimal('0.0004')
  73. },
  74. 'text-embedding-ada-002': {
  75. 'usage': Decimal('0.0004'),
  76. }
  77. }
  78. agent_model_name = 'text-davinci-003'