mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
[OpenRouter] Switch to token per dollar for prices
This commit is contained in:
@ -722,9 +722,9 @@ function saveModelList(data) {
|
||||
$('#model_openrouter_select').empty();
|
||||
$('#model_openrouter_select').append($('<option>', { value: openrouter_website_model, text: 'Use OpenRouter website setting' }));
|
||||
model_list.forEach((model) => {
|
||||
let prompt_max_price = parseFloat(model.pricing.prompt) * model.context_length;
|
||||
let price_rounded = (Math.round(prompt_max_price * 1000) / 1000).toFixed(3);
|
||||
let model_description = `${model.id} \$${price_rounded} (${model.context_length})`;
|
||||
let tokens_dollar = parseFloat(1 / (1000 * model.pricing.prompt));
|
||||
let tokens_rounded = (Math.round(tokens_dollar * 1000) / 1000).toFixed(0);
|
||||
let model_description = `${model.id} | ${tokens_rounded}k t/$ | ${model.context_length} ctx`;
|
||||
$('#model_openrouter_select').append(
|
||||
$('<option>', {
|
||||
value: model.id,
|
||||
|
Reference in New Issue
Block a user