Skip to content

Commit 8fb9428

Browse files
author
Mr. House
committed
Strip temperature and top_p for all models (no model-specific checks)
1 parent 06eb6b1 commit 8fb9428

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

anthropic-proxy.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,15 @@ function modelsResponse() {
5656
// Parameters SillyTavern sends that Anthropic doesn't support — strip them
5757
const STRIP_PARAMS = ['presence_penalty', 'frequency_penalty', 'logit_bias', 'seed', 'response_format', 'function_call', 'functions'];
5858

59-
// Models that reject temperature parameter via the Anthropic API
60-
// (Opus 4.7 introduced this restriction; other models accept it)
61-
const MODELS_NO_TEMPERATURE = ['claude-opus-4-7'];
62-
6359
// Convert OpenAI chat/completions format to Anthropic messages format
6460
function openAIToAnthropic(body, isOAuth) {
6561
const payload = JSON.parse(body);
6662

67-
// Strip SillyTavern-specific unsupported parameters
63+
// Strip ALL OpenAI-specific params that don't exist in Anthropic /v1/messages
64+
// OpenAI supports many params Anthropic doesn't: temperature, top_p, etc.
6865
for (const p of STRIP_PARAMS) delete payload[p];
69-
70-
// Strip temperature only for models that reject it
71-
// Normalize model name: "anthropic/claude-opus-4-7" → "claude-opus-4-7" for comparison
72-
const modelShort = payload.model ? payload.model.replace(/^anthropic\//, '') : null;
73-
if (modelShort && MODELS_NO_TEMPERATURE.includes(modelShort)) {
74-
delete payload.temperature;
75-
}
66+
delete payload.temperature; // Not supported by Anthropic messages endpoint
67+
delete payload.top_p; // Not supported by Anthropic messages endpoint
7668

7769
const result = {
7870
model: payload.model,

0 commit comments

Comments
 (0)