Skip to content

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

fix(seeder): align agentic seed summaries (#14209)

Nikita Kabardin3483c8ada07a
diff --git a/packages/shared/scripts/seeder/scenarios/many-traces.ts b/packages/shared/scripts/seeder/scenarios/many-traces.ts
index 098ed02f3f..7d47a21e46 100644
--- a/packages/shared/scripts/seeder/scenarios/many-traces.ts
+++ b/packages/shared/scripts/seeder/scenarios/many-traces.ts
@@ -12,6 +12,8 @@ import {
import { utcDayStartMs } from "./rng";
import { countRows, escapeLike, tracesListLink } from "./verify";
+const SESSION_POOL_SIZE = 100;
+
/**
* Loads the bundled large fixtures, sliced exactly like SeederOrchestrator so
* the inline INSERT ... SELECT FROM numbers() SQL stays under ClickHouse's
@@ -71,6 +73,7 @@ const run = async (
const builder = new ClickHouseQueryBuilder();
const fileContent = richPayloads ? loadFileContent() : undefined;
const counts: Record<string, number> = {
+ sessions: SESSION_POOL_SIZE,
traces: count,
observations: count * observationsPerTrace,
scores: count * scoresPerTrace,
@@ -158,7 +161,7 @@ const run = async (
// session detail page 404s without the Postgres trace_sessions rows
// (same contract long-session handles for its own session).
await prisma.traceSession.createMany({
- data: Array.from({ length: 100 }, (_, i) => ({
+ data: Array.from({ length: SESSION_POOL_SIZE }, (_, i) => ({
id: `${ctx.idPrefix}-session_${i}`,
projectId: ctx.projectId,
environment: ctx.environment,
diff --git a/packages/shared/scripts/seeder/scenarios/trace-tree.ts b/packages/shared/scripts/seeder/scenarios/trace-tree.ts
index 7ddd3df273..35e85c274c 100644
--- a/packages/shared/scripts/seeder/scenarios/trace-tree.ts
+++ b/packages/shared/scripts/seeder/scenarios/trace-tree.ts
@@ -114,7 +114,7 @@ const run = async (
const startedAt = Date.now();
const observationCount = params["observations"] as number;
const requestedDepth = params["depth"] as number;
- const breadth = params["breadth"] as number;
+ const requestedBreadth = params["breadth"] as number;
// depth deeper than the observation count is geometrically impossible;
// clamping it down is helpful, not a silent rewrite of intent (the
// validator below enforces the >= 2 lower bound on the requested value)
@@ -135,9 +135,9 @@ const run = async (
"pass at least 2 (root plus one level), e.g. --depth 8",
);
}
- if (breadth < 1) {
+ if (requestedBreadth < 1) {
throw new SeedError(
- `--breadth must be >= 1, got ${breadth}`,
+ `--breadth must be >= 1, got ${requestedBreadth}`,
"pass a positive integer, e.g. --breadth 30",
);
}
@@ -154,6 +154,10 @@ const run = async (
);
}
+ const breadth = Math.min(
+ requestedBreadth,
+ Math.max(0, observationCount - depth),
+ );
const rng = new Rng(ctx.seed);
const traceId = `${ctx.idPrefix}-trace`;
const traceTimestamp = utcDayStartMs();
diff --git a/packages/shared/scripts/seeder/utils/clickhouse-builder.ts b/packages/shared/scripts/seeder/utils/clickhouse-builder.ts
index c35b69b8a1..9de60a1249 100644
--- a/packages/shared/scripts/seeder/utils/clickhouse-builder.ts
+++ b/packages/shared/scripts/seeder/utils/clickhouse-builder.ts
@@ -243,7 +243,7 @@ export class ClickHouseQueryBuilder {
if(h2 % 10 >= 7, '${escapedNestedJson}', '${escapedChatMl}'),
NULL) AS output,
if(type = 'GENERATION', 'gpt-4', NULL) AS provided_model_name,
- if(type = 'GENERATION', concat('model_', toString(h2 % 1000)), NULL) AS internal_model_id,
+ NULL AS internal_model_id,
if(type = 'GENERATION', '{"temperature": 0.7}', '{}') AS model_parameters,
if(type = 'GENERATION', map('input', toUInt64(20 + h1 % 181), 'output', toUInt64(10 + h2 % 91), 'total', toUInt64(30 + h1 % 181 + h2 % 91)), map()) AS provided_usage_details,
if(type = 'GENERATION', map('input', toUInt64(20 + h1 % 181), 'output', toUInt64(10 + h2 % 91), 'total', toUInt64(30 + h1 % 181 + h2 % 91)), map()) AS usage_details,