Merge pull request #3577 from SillyTavern/the-best-model-tm Add gpt-4.5-preview (best model ™️ - most expensive for sure)

9c4bffc4872cfb4afcbc3c42cfe00dd24a134187

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
4 files changed, +12 -1Ignore whitespace
public/index.html+4 -0
@@ -2867,6 +2867,10 @@
28672867 <option value="o3-mini">o3-mini</option>
28682868 <option value="o3-mini-2025-01-31">o3-mini-2025-01-31</option>
28692869 </optgroup>
2870+ <optgroup label="GPT-4.5">
2871+ <option value="gpt-4.5-preview">gpt-4.5-preview</option>
2872+ <option value="gpt-4.5-preview-2025-02-27">gpt-4.5-preview-2025-02-27</option>
2873+ </optgroup>
28702874 <optgroup label="GPT-4 Turbo and GPT-4">
28712875 <option value="gpt-4-turbo">gpt-4-turbo</option>
28722876 <option value="gpt-4-turbo-2024-04-09">gpt-4-turbo-2024-04-09</option>
public/scripts/openai.js+3 -1
@@ -1945,7 +1945,7 @@ async function sendOpenAIRequest(type, messages, signal) {
19451945 }
19461946
19471947 // Remove logit bias, logprobs and stop strings if it's not supported by the model
19481948 if (isOAI && oai_settings.openai_model.includes('vision') || isOpenRouter && oai_settings.openrouter_model.includes('vision') || isOAI && oai_settings.openai_model.includes('gpt-4.5-preview')) {
19491949 delete generate_data.logit_bias;
19501950 delete generate_data.stop;
19511951 delete generate_data.logprobs;
@@ -4997,6 +4997,8 @@ export function isImageInliningSupported() {
49974997 'gpt-4-turbo',
49984998 'gpt-4o',
49994999 'gpt-4o-mini',
5000+ 'gpt-4.5-preview',
5001+ 'gpt-4.5-preview-2025-02-27',
50005002 'o1',
50015003 'o1-2024-12-17',
50025004 'chatgpt-4o-latest',
public/scripts/reasoning.js+1 -0
@@ -108,6 +108,7 @@ export function isHiddenReasoningModel() {
108108
109109 /** @type {{ name: string; func: MatchingFunc; }[]} */
110110 const hiddenReasoningModels = [
111+ { name: 'gpt-4.5', func: FUNCS.startsWith },
111112 { name: 'o1', func: FUNCS.startsWith },
112113 { name: 'o3', func: FUNCS.startsWith },
113114 { name: 'gemini-2.0-flash-thinking-exp', func: FUNCS.startsWith },
src/endpoints/tokenizers.js+4 -0
@@ -410,6 +410,10 @@ export function getTokenizerModel(requestModel) {
410410 return 'gpt-4o';
411411 }
412412
413+ if (requestModel.includes('gpt-4.5-preview')) {
414+ return 'gpt-4o';
415+ }
416+
413417 if (requestModel.includes('gpt-4-32k')) {
414418 return 'gpt-4-32k';
415419 }