Skip to content

Commit 7cd6520

Browse files
authored
Fix Groq context window display (#7839)
1 parent 48d592f commit 7cd6520

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

src/api/providers/__tests__/groq.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ describe("GroqHandler", () => {
149149
expect(firstChunk.done).toBe(false)
150150
expect(firstChunk.value).toMatchObject({
151151
type: "usage",
152-
inputTokens: 70, // 100 total - 30 cached
152+
inputTokens: 100,
153153
outputTokens: 50,
154154
cacheWriteTokens: 0,
155155
cacheReadTokens: 30,

src/api/providers/groq.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,9 @@ export class GroqHandler extends BaseOpenAiCompatibleProvider<GroqModelId> {
6666
// Calculate cost using OpenAI-compatible cost calculation
6767
const totalCost = calculateApiCostOpenAI(info, inputTokens, outputTokens, cacheWriteTokens, cacheReadTokens)
6868

69-
// Calculate non-cached input tokens for proper reporting
70-
const nonCachedInputTokens = Math.max(0, inputTokens - cacheReadTokens - cacheWriteTokens)
71-
72-
console.log("usage", {
73-
inputTokens: nonCachedInputTokens,
74-
outputTokens,
75-
cacheWriteTokens,
76-
cacheReadTokens,
77-
totalCost,
78-
})
79-
8069
yield {
8170
type: "usage",
82-
inputTokens: nonCachedInputTokens,
71+
inputTokens,
8372
outputTokens,
8473
cacheWriteTokens,
8574
cacheReadTokens,

0 commit comments

Comments
 (0)