From a16ba559fbfae5a125fe224208f8d119211d6523 Mon Sep 17 00:00:00 2001 From: NovaOSS Admins Date: Mon, 16 Oct 2023 21:55:54 +0000 Subject: [PATCH] Much cheaper API --- api/responder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/responder.py b/api/responder.py index ef33735..cc89007 100644 --- a/api/responder.py +++ b/api/responder.py @@ -225,9 +225,12 @@ async def respond( if is_chat: model_multiplier = model_multipliers['chat-models'].get(payload.get('model'), model_multiplier) total_tokens = input_tokens + output_tokens - credits_cost = total_tokens / 10 + credits_cost = total_tokens / 60 credits_cost = round(credits_cost * model_multiplier) + if credits_cost < 1: + credits_cost = 1 + tokens = { 'input': input_tokens, 'output': output_tokens,