Compare commits

...
7 Commits
Author SHA1 Message Date
Max Deichmann 4e44987e12 chore: release v2.60.4
CI/CD / lint (push) Waiting to run
CI/CD / test-docker-build (push) Waiting to run
CI/CD / tests-web (node20, pg12) (push) Waiting to run
CI/CD / tests-web (node20, pg15) (push) Waiting to run
CI/CD / tests-worker (node20, pg12) (push) Waiting to run
CI/CD / tests-worker (node20, pg15) (push) Waiting to run
CI/CD / e2e-tests (push) Waiting to run
CI/CD / all-ci-passed (push) Blocked by required conditions
CI/CD / push-docker-image (push) Blocked by required conditions
release.yml / release (push) Waiting to run
Snyk Container / snyk (push) Waiting to run
2024-07-08 14:03:26 +02:00
Max DeichmannandGitHub e0f605a0f2 fix: correctly sample evals (#2562) 2024-07-08 14:00:07 +02:00
Marc Klingen 05a4935a91 chore: release v2.60.3
CI/CD / lint (push) Waiting to run
CI/CD / test-docker-build (push) Waiting to run
CI/CD / tests-web (node20, pg12) (push) Waiting to run
CI/CD / tests-web (node20, pg15) (push) Waiting to run
CI/CD / tests-worker (node20, pg12) (push) Waiting to run
CI/CD / tests-worker (node20, pg15) (push) Waiting to run
CI/CD / e2e-tests (push) Waiting to run
CI/CD / all-ci-passed (push) Blocked by required conditions
CI/CD / push-docker-image (push) Blocked by required conditions
release.yml / release (push) Waiting to run
Snyk Container / snyk (push) Waiting to run
2024-07-08 12:51:42 +02:00
Marc Klingen 27e1dca4df fix(api): scores parsing error on GET /scores leading to dropped scores 2024-07-08 12:51:21 +02:00
Hassieb PakzadandGitHub 53e4433032 perf(dashboards): read directly from observations table for costs (#2568) 2024-07-08 11:52:50 +02:00
Marc Klingen c777d91f13 chore: typo in prisma schema 2024-07-08 11:41:06 +02:00
Marc KlingenandGitHub ce1e4318e4 chore: run arm builds on tagged commits only (#2561) 2024-07-08 10:02:55 +02:00
13 changed files with 123 additions and 11 deletions
+2 -2
View File
@@ -292,7 +292,7 @@ jobs:
labels: ${{ steps.meta-web.outputs.labels }}
platforms: |
linux/amd64
linux/arm64
${{ startsWith(github.ref, 'refs/tags/') && 'linux/arm64' || '' }}
- name: Extract metadata (tags, labels) for Docker
id: meta-worker
@@ -319,4 +319,4 @@ jobs:
labels: ${{ steps.meta-worker.outputs.labels }}
platforms: |
linux/amd64
linux/arm64
${{ startsWith(github.ref, 'refs/tags/') && 'linux/arm64' || '' }}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "langfuse",
"version": "2.60.2",
"version": "2.60.4",
"author": "engineering@langfuse.com",
"license": "MIT",
"private": true,
+1 -1
View File
@@ -363,7 +363,7 @@ view ObservationView {
statusMessage String? @map("status_message")
version String?
createdAt DateTime @map("created_at")
updateAt DateTime @map("updated_at")
updatedAt DateTime @map("updated_at")
// GENERATION ONLY
model String?
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "web",
"version": "2.60.2",
"version": "2.60.4",
"private": true,
"license": "MIT",
"engines": {
+1 -1
View File
@@ -1 +1 @@
export const VERSION = "v2.60.2";
export const VERSION = "v2.60.4";
@@ -23,7 +23,7 @@ export const MetricTable = ({
{
projectId,
from: env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION // Langfuse Cloud has already completed the cost backfill job, thus cost can be pulled directly from obs. table
? "traces_observations"
? "observations"
: "traces_observationsview",
select: [
{ column: "calculatedTotalCost", agg: "SUM" },
@@ -37,7 +37,7 @@ export const ModelUsageChart = ({
{
projectId,
from: env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION // Langfuse Cloud has already completed the cost backfill job, thus cost can be pulled directly from obs. table
? "traces_observations"
? "observations"
: "traces_observationsview",
select: [
{ column: "totalTokens", agg: "SUM" },
+1 -1
View File
@@ -68,7 +68,7 @@ const GetScoresDataBase = z.object({
traceId: z.string(),
observationId: z.string().nullish(),
trace: z.object({
userId: z.string(),
userId: z.string().nullish(),
}),
configId: z.string().nullish(),
});
+1
View File
@@ -137,6 +137,7 @@ export default withMiddlewares({
if (result.success) {
acc.push(result.data);
} else {
console.error("Score parsing error: ", result.error);
Sentry.captureException(result.error);
}
return acc;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "worker",
"version": "2.60.2",
"version": "2.60.4",
"description": "",
"license": "MIT",
"private": true,
+98
View File
@@ -199,6 +199,104 @@ describe("create eval jobs", () => {
expect(jobs[0].end_time).to.be.null;
}, 10_000);
test("does not create job for inactive config", async () => {
await pruneDatabase();
const traceId = randomUUID();
await kyselyPrisma.$kysely
.insertInto("traces")
.values({
id: traceId,
project_id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
})
.execute();
await prisma.jobConfiguration.create({
data: {
id: randomUUID(),
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
filter: JSON.parse("[]"),
jobType: "EVAL",
delay: 0,
sampling: new Decimal("1"),
targetObject: "traces",
scoreName: "score",
variableMapping: JSON.parse("[]"),
status: "INACTIVE",
},
});
const payload = {
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
traceId: traceId,
};
await createEvalJobs({ event: payload });
const jobs = await kyselyPrisma.$kysely
.selectFrom("job_executions")
.selectAll()
.where("project_id", "=", "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a")
.execute();
expect(jobs.length).toBe(0);
}, 10_000);
test("does not create eval job for 0 sample rate", async () => {
await pruneDatabase();
const traceId = randomUUID();
await kyselyPrisma.$kysely
.insertInto("traces")
.values({
id: traceId,
project_id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
})
.execute();
await kyselyPrisma.$kysely
.insertInto("llm_api_keys")
.values({
id: randomUUID(),
project_id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
secret_key: encrypt(String(OPENAI_API_KEY)),
provider: "openai",
adapter: LLMAdapter.OpenAI,
custom_models: [],
display_secret_key: "123456",
})
.execute();
await prisma.jobConfiguration.create({
data: {
id: randomUUID(),
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
filter: JSON.parse("[]"),
jobType: "EVAL",
delay: 0,
sampling: new Decimal("0"),
targetObject: "traces",
scoreName: "score",
variableMapping: JSON.parse("[]"),
},
});
const payload = {
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
traceId: traceId,
};
await createEvalJobs({ event: payload });
const jobs = await kyselyPrisma.$kysely
.selectFrom("job_executions")
.selectAll()
.where("project_id", "=", "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a")
.execute();
expect(jobs.length).toBe(0);
}, 10_000);
test("cancels a job if the second event deselects", async () => {
await pruneDatabase();
const traceId = randomUUID();
+1 -1
View File
@@ -1 +1 @@
export const VERSION = "v2.60.2";
export const VERSION = "v2.60.4";
@@ -98,6 +98,19 @@ export const createEvalJobs = async ({
continue;
}
// apply sampling. Only if the job is sampled, we create a job
// user supplies a number between 0 and 1, which is the probability of sampling
if (parseFloat(config.sampling) !== 1) {
const random = Math.random();
if (random > parseFloat(config.sampling)) {
logger.info(
`Eval job for config ${config.id} and trace ${event.traceId} was sampled out`
);
continue;
}
}
logger.info(
`Creating eval job for config ${config.id} and trace ${event.traceId}`
);