Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(cloud): only active evals should count towards plan limit (#5793)

Marc Klingena86f0ab26348
diff --git a/web/src/ee/features/evals/pages/evaluators.tsx b/web/src/ee/features/evals/pages/evaluators.tsx
index 59823a96e3..3e642f91d6 100644
--- a/web/src/ee/features/evals/pages/evaluators.tsx
+++ b/web/src/ee/features/evals/pages/evaluators.tsx
@@ -110,7 +110,7 @@ export default function EvaluatorsPage() {
variant="outline"
onClick={() => capture("eval_config:new_form_open")}
href={`/project/${projectId}/evals/new`}
- limitValue={countsQuery.data?.configCount ?? 0}
+ limitValue={countsQuery.data?.configActiveCount ?? 0}
limit={evaluatorLimit}
>
New evaluator
diff --git a/web/src/ee/features/evals/server/router.ts b/web/src/ee/features/evals/server/router.ts
index fc33c0344d..8ab39dc2dd 100644
--- a/web/src/ee/features/evals/server/router.ts
+++ b/web/src/ee/features/evals/server/router.ts
@@ -149,22 +149,32 @@ export const evalRouter = createTRPCRouter({
scope: "evalJob:read",
});
- const [configCount, templateCount] = await Promise.all([
- ctx.prisma.jobConfiguration.count({
- where: {
- projectId: input.projectId,
- jobType: "EVAL",
- },
- }),
- ctx.prisma.evalTemplate.count({
- where: {
- projectId: input.projectId,
- },
- }),
- ]);
+ const [configCount, configActiveCount, templateCount] = await Promise.all(
+ [
+ ctx.prisma.jobConfiguration.count({
+ where: {
+ projectId: input.projectId,
+ jobType: "EVAL",
+ },
+ }),
+ ctx.prisma.jobConfiguration.count({
+ where: {
+ projectId: input.projectId,
+ jobType: "EVAL",
+ status: "ACTIVE",
+ },
+ }),
+ ctx.prisma.evalTemplate.count({
+ where: {
+ projectId: input.projectId,
+ },
+ }),
+ ],
+ );
return {
configCount,
+ configActiveCount,
templateCount,
};
}),