@@ -28,8 +28,6 @@ import {
2828 isAnonymousContext ,
2929 type AnonymousUserContext ,
3030} from '@/lib/anonymous' ;
31- import { checkPromotionLimit } from '@/lib/free-model-rate-limiter' ;
32- import { PROMOTION_MAX_REQUESTS , PROMOTION_WINDOW_HOURS } from '@/lib/constants' ;
3331import { emitApiMetricsForResponse } from '@/lib/o11y/api-metrics.server' ;
3432import { normalizeModelId } from '@/lib/model-utils' ;
3533import { buildUpstreamBody , type EmbeddingProxyRequest } from '@/lib/embeddings/embedding-request' ;
@@ -39,7 +37,6 @@ import { getVercelInferenceProviderConfigForUserByok } from '@/lib/providers/ver
3937export const maxDuration = 300 ;
4038
4139const PAID_MODEL_AUTH_REQUIRED = 'PAID_MODEL_AUTH_REQUIRED' ;
42- const PROMOTION_MODEL_LIMIT_REACHED = 'PROMOTION_MODEL_LIMIT_REACHED' ;
4340
4441async function embeddingProxyRequest ( params : {
4542 body : Record < string , unknown > ;
@@ -134,27 +131,6 @@ export async function POST(request: NextRequest): Promise<NextResponseType<unkno
134131 ) ;
135132 }
136133
137- const promotionLimit = await checkPromotionLimit ( ipAddress ) ;
138- if ( ! promotionLimit . allowed ) {
139- console . warn (
140- `Promotion model limit exceeded, ip: ${ ipAddress } , ` +
141- `model: ${ requestedModelLowerCased } , ` +
142- `requests: ${ promotionLimit . requestCount } /${ PROMOTION_MAX_REQUESTS } ` +
143- `in ${ PROMOTION_WINDOW_HOURS } h window`
144- ) ;
145- return NextResponse . json (
146- {
147- error : {
148- code : PROMOTION_MODEL_LIMIT_REACHED ,
149- message :
150- 'Sign up for free to continue and explore 500 other models. ' +
151- 'Takes 2 minutes, no credit card required. Or come back later.' ,
152- } ,
153- } ,
154- { status : 401 }
155- ) ;
156- }
157-
158134 user = createAnonymousContext ( ipAddress ) ;
159135 organizationId = undefined ;
160136 } else {
0 commit comments