example.json 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. {
  2. "user_patches": [
  3. {
  4. "name": "custom_temperature_limit",
  5. "description": "Limit temperature to 1.5 for all models",
  6. "conditions": [
  7. {
  8. "key": "temperature",
  9. "operator": "exists",
  10. "value": ""
  11. }
  12. ],
  13. "operations": [
  14. {
  15. "op": "limit",
  16. "key": "temperature",
  17. "value": 1.5
  18. }
  19. ]
  20. },
  21. {
  22. "name": "add_default_top_p",
  23. "description": "Add default top_p if not specified",
  24. "conditions": [
  25. {
  26. "key": "top_p",
  27. "operator": "not_exists",
  28. "value": ""
  29. }
  30. ],
  31. "operations": [
  32. {
  33. "op": "add",
  34. "key": "top_p",
  35. "value": 0.9
  36. }
  37. ]
  38. },
  39. {
  40. "name": "remove_system_fingerprint_for_old_models",
  41. "description": "Remove system_fingerprint for models that don't support it",
  42. "conditions": [
  43. {
  44. "key": "model",
  45. "operator": "regex",
  46. "value": "gpt-3\\.5-turbo"
  47. },
  48. {
  49. "key": "system_fingerprint",
  50. "operator": "exists",
  51. "value": ""
  52. }
  53. ],
  54. "operations": [
  55. {
  56. "op": "delete",
  57. "key": "system_fingerprint"
  58. }
  59. ]
  60. },
  61. {
  62. "name": "anthropic_specific_settings",
  63. "description": "Apply Anthropic-specific optimizations",
  64. "conditions": [
  65. {
  66. "key": "model",
  67. "operator": "contains",
  68. "value": "claude"
  69. }
  70. ],
  71. "operations": [
  72. {
  73. "op": "limit",
  74. "key": "max_tokens",
  75. "value": 4096
  76. },
  77. {
  78. "op": "set",
  79. "key": "anthropic_version",
  80. "value": "2023-06-01"
  81. }
  82. ]
  83. },
  84. {
  85. "name": "convert_legacy_stop_to_stop_sequences",
  86. "description": "Convert stop parameter to stop_sequences for Claude models",
  87. "conditions": [
  88. {
  89. "key": "model",
  90. "operator": "contains",
  91. "value": "claude"
  92. },
  93. {
  94. "key": "stop",
  95. "operator": "exists",
  96. "value": ""
  97. }
  98. ],
  99. "operations": [
  100. {
  101. "op": "set",
  102. "key": "stop_sequences",
  103. "value": "{{stop}}"
  104. },
  105. {
  106. "op": "delete",
  107. "key": "stop"
  108. }
  109. ]
  110. },
  111. {
  112. "name": "nested_parameter_example",
  113. "description": "Example of setting nested parameters",
  114. "conditions": [
  115. {
  116. "key": "model",
  117. "operator": "equals",
  118. "value": "example-model"
  119. }
  120. ],
  121. "operations": [
  122. {
  123. "op": "set",
  124. "key": "generation_config.max_output_tokens",
  125. "value": 2048
  126. },
  127. {
  128. "op": "set",
  129. "key": "generation_config.temperature",
  130. "value": 0.7
  131. },
  132. {
  133. "op": "set",
  134. "key": "safety_settings.category",
  135. "value": "HARM_CATEGORY_DANGEROUS_CONTENT"
  136. }
  137. ]
  138. },
  139. {
  140. "name": "model_specific_token_limits",
  141. "description": "Set appropriate token limits based on model capabilities",
  142. "conditions": [
  143. {
  144. "key": "original_model",
  145. "operator": "regex",
  146. "value": "gpt-4-turbo"
  147. }
  148. ],
  149. "operations": [
  150. {
  151. "op": "limit",
  152. "key": "max_tokens",
  153. "value": 4096
  154. }
  155. ]
  156. }
  157. ]
  158. }