llm_constant.py 2.5 KB

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