Skip to content

Commit 7fa9eb4

Browse files
Copilotrajbos
andcommitted
Update model multipliers, plan limits, and excess request cost based on feedback
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
1 parent 7629db3 commit 7fa9eb4

2 files changed

Lines changed: 50 additions & 25 deletions

File tree

src/lib/utils.ts

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ export function getModelUsageSummary(data: CopilotUsageData[]): ModelUsageSummar
184184
compliantRequests: 0,
185185
exceedingRequests: 0,
186186
multiplier,
187-
individualPlanLimit: Math.floor(PLAN_MONTHLY_LIMITS[COPILOT_PLANS.INDIVIDUAL] / multiplier),
188-
businessPlanLimit: Math.floor(PLAN_MONTHLY_LIMITS[COPILOT_PLANS.BUSINESS] / multiplier),
189-
enterprisePlanLimit: Math.floor(PLAN_MONTHLY_LIMITS[COPILOT_PLANS.ENTERPRISE] / multiplier),
187+
individualPlanLimit: multiplier === 0 ? Infinity : Math.floor(PLAN_MONTHLY_LIMITS[COPILOT_PLANS.INDIVIDUAL] / multiplier),
188+
businessPlanLimit: multiplier === 0 ? Infinity : Math.floor(PLAN_MONTHLY_LIMITS[COPILOT_PLANS.BUSINESS] / multiplier),
189+
enterprisePlanLimit: multiplier === 0 ? Infinity : Math.floor(PLAN_MONTHLY_LIMITS[COPILOT_PLANS.ENTERPRISE] / multiplier),
190190
excessCost: 0
191191
};
192192
}
@@ -219,6 +219,14 @@ export function getModelUsageSummary(data: CopilotUsageData[]): ModelUsageSummar
219219
groupedSummary[key].exceedingRequests += item.exceedingRequests;
220220
}
221221

222+
// For grouped default models, ensure multiplier is 0 and limits are set correctly
223+
if (key === 'Default') {
224+
groupedSummary[key].multiplier = 0;
225+
groupedSummary[key].individualPlanLimit = Infinity;
226+
groupedSummary[key].businessPlanLimit = Infinity;
227+
groupedSummary[key].enterprisePlanLimit = Infinity;
228+
}
229+
222230
// Calculate excess cost
223231
groupedSummary[key].excessCost = groupedSummary[key].exceedingRequests * groupedSummary[key].multiplier * EXCESS_REQUEST_COST;
224232
});
@@ -281,29 +289,46 @@ export const COPILOT_PLANS = {
281289
} as const;
282290

283291
export const PLAN_MONTHLY_LIMITS = {
284-
[COPILOT_PLANS.INDIVIDUAL]: 150,
285-
[COPILOT_PLANS.BUSINESS]: 500,
286-
[COPILOT_PLANS.ENTERPRISE]: 500
292+
[COPILOT_PLANS.INDIVIDUAL]: 50,
293+
[COPILOT_PLANS.BUSINESS]: 300,
294+
[COPILOT_PLANS.ENTERPRISE]: 1000
287295
} as const;
288296

289-
// Model multipliers based on GitHub documentation
297+
// Model multipliers based on GitHub documentation (for paid plans)
290298
export const MODEL_MULTIPLIERS: Record<string, number> = {
291-
// Default models (1x multiplier)
292-
'gpt-4o-2024-11-20': 1,
293-
'gpt-4.1-2025-04-14': 1,
299+
// Default models (0x multiplier for paid plans)
300+
'gpt-4o-2024-11-20': 0,
301+
'gpt-4.1-2025-04-14': 0,
302+
'gpt-4o': 0,
303+
'gpt-4.1': 0,
304+
// GPT-4.5 models
305+
'gpt-4.5': 50,
294306
// Vision models
295-
'gpt-4.1-vision': 1,
296-
// O-series models (higher multipliers)
297-
'o3-mini-2025-01-31': 1,
298-
'o4-mini-2025-04-16': 1,
307+
'gpt-4.1-vision': 0,
308+
// Claude models
309+
'claude-sonnet-3.5': 1,
310+
'claude-sonnet-3.7': 1,
311+
'claude-sonnet-3.7-thinking': 1.25,
312+
'claude-sonnet-4': 1,
313+
'claude-opus-4': 10,
314+
// Gemini models
315+
'gemini-2.0-flash': 0.25,
316+
'gemini-2.5-pro': 1,
317+
// O-series models
318+
'o1': 10,
319+
'o3': 1,
320+
'o3-mini': 0.33,
321+
'o3-mini-2025-01-31': 0.33,
322+
'o4-mini': 0.33,
323+
'o4-mini-2025-04-16': 0.33,
299324
// Add other models as needed - fallback to 1x for unknown models
300325
};
301326

302327
// Default models that should be grouped
303328
export const DEFAULT_MODELS = ['gpt-4o-2024-11-20', 'gpt-4.1-2025-04-14'];
304329

305330
// Cost per excess request (in USD) for premium requests
306-
export const EXCESS_REQUEST_COST = 0.15; // $0.15 per excess request
331+
export const EXCESS_REQUEST_COST = 0.04; // $0.04 per excess request
307332

308333
export function getPowerUsers(data: CopilotUsageData[]): PowerUserSummary {
309334
// First, aggregate total requests per user

src/test/model-info-limits.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ describe('Model Info and Limits Feature', () => {
5252
expect(defaultGroup).toBeDefined();
5353

5454
if (defaultGroup) {
55-
expect(defaultGroup.multiplier).toBe(1);
56-
expect(defaultGroup.individualPlanLimit).toBe(150); // 150 / 1
57-
expect(defaultGroup.businessPlanLimit).toBe(500); // 500 / 1
58-
expect(defaultGroup.enterprisePlanLimit).toBe(500); // 500 / 1
55+
expect(defaultGroup.multiplier).toBe(0);
56+
expect(defaultGroup.individualPlanLimit).toBe(Infinity); // 0x multiplier = unlimited
57+
expect(defaultGroup.businessPlanLimit).toBe(Infinity); // 0x multiplier = unlimited
58+
expect(defaultGroup.enterprisePlanLimit).toBe(Infinity); // 0x multiplier = unlimited
5959
}
6060
});
6161

@@ -98,14 +98,14 @@ describe('Model Info and Limits Feature', () => {
9898
expect(defaultGroup).toBeDefined();
9999

100100
if (defaultGroup) {
101-
// 50 exceeding requests * 1x multiplier * $0.15 = $7.50
102-
expect(defaultGroup.excessCost).toBe(50 * 1 * EXCESS_REQUEST_COST);
101+
// 50 exceeding requests * 0x multiplier * $0.04 = $0.00
102+
expect(defaultGroup.excessCost).toBe(50 * 0 * EXCESS_REQUEST_COST);
103103
}
104104

105105
const o3Model = result.find(item => item.model === 'o3-mini-2025-01-31');
106106
if (o3Model) {
107-
// 10 exceeding requests * 1x multiplier * $0.15 = $1.50
108-
expect(o3Model.excessCost).toBe(10 * 1 * EXCESS_REQUEST_COST);
107+
// 10 exceeding requests * 0.33x multiplier * $0.04 = $0.132
108+
expect(o3Model.excessCost).toBe(10 * 0.33 * EXCESS_REQUEST_COST);
109109
}
110110
});
111111

@@ -157,8 +157,8 @@ describe('Model Info and Limits Feature', () => {
157157
expect(result).toHaveLength(1);
158158
expect(result[0].model).toBe('unknown-model-2025');
159159
expect(result[0].multiplier).toBe(1); // Default multiplier
160-
expect(result[0].individualPlanLimit).toBe(150); // 150 / 1
161-
expect(result[0].businessPlanLimit).toBe(500); // 500 / 1
160+
expect(result[0].individualPlanLimit).toBe(50); // 50 / 1
161+
expect(result[0].businessPlanLimit).toBe(300); // 300 / 1
162162
});
163163

164164
it('should sort results by total requests descending', () => {

0 commit comments

Comments
 (0)