fixes claude-opus token usage being attributed to regular claude

This commit is contained in:
nai-degen
2024-03-04 17:03:02 -06:00
parent 51ffca480a
commit 6b22d17c50
3 changed files with 9 additions and 7 deletions
+4 -1
View File
@@ -12,6 +12,7 @@ import schedule from "node-schedule";
import { v4 as uuid } from "uuid";
import { config, getFirebaseApp } from "../../config";
import {
getAwsBedrockModelFamily,
getAzureOpenAIModelFamily,
getClaudeModelFamily,
getGoogleAIModelFamily,
@@ -393,8 +394,10 @@ function getModelFamilyForQuotaUsage(
model: string,
api: APIFormat
): ModelFamily {
// TODO: this seems incorrect
// "azure" here is added to model names by the Azure key provider to
// differentiate between Azure and OpenAI variants of the same model.
if (model.includes("azure")) return getAzureOpenAIModelFamily(model);
if (model.includes("anthropic.")) return getAwsBedrockModelFamily(model);
switch (api) {
case "openai":