langsmith_evaluation

langsmith_evaluation is a cursor rule for Cursor from yu-iskw/llmops-demo-ts. It costs 0 tokens per session (1,786 once invoked), scanned A, original, Apache-2.0.

A guide for evaluating Google Gen AI applications with LangSmith, a service for storing test examples and comparing model outputs. It covers setup, datasets, target functions, evaluators, and evaluation runs.

In plain words
What is it for?
Use it to create evaluation datasets, define scoring functions, and run checks on Gemini-based application behavior.
Why use it?
It provides a repeatable way to check generated answers against examples instead of judging model changes only by occasional manual inspection.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/yu-iskw/llmops-demo-ts/langsmith_evaluation
Clone the repo
git clone --depth 1 https://github.com/yu-iskw/llmops-demo-ts

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for langsmith_evaluation

README.md
[![agentmods](https://agentmods.dev/badge/rules/yu-iskw/llmops-demo-ts/langsmith_evaluation.svg)](https://agentmods.dev/rules/yu-iskw/llmops-demo-ts/langsmith_evaluation)
Your own site
<a href="https://agentmods.dev/rules/yu-iskw/llmops-demo-ts/langsmith_evaluation"><img src="https://agentmods.dev/badge/rules/yu-iskw/llmops-demo-ts/langsmith_evaluation.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,786 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01786
Opus 5 $0.00000 $0.00893
Sonnet 5 $0.00000 $0.00357
Haiku 4.5 $0.00000 $0.00179

Measured today against content hash 136c9d9cb632, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

langsmith_evaluation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/langsmith_evaluation.mdc · 201 lines

How it starts

The opening of the file, as written. The whole thing — 201 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LangSmith Evaluation with @google/genai

This rule provides a comprehensive guide for setting up and running evaluations with LangSmith, specifically tailored for integrations with @google/genai (Gemini on Vertex AI).

1. Setup Environment Variables

Before using @google/genai, ensure the following environment variables are set in your shell:

  • GOOGLE_API_KEY (for Google API Key authentication)
  • OR
  • GOOGLE_GENAI_USE_VERTEXAI=true (to enable Vertex AI)
  • GOOGLE_CLOUD_PROJECT (your Google Cloud project ID)
  • GOOGLE_CLOUD_LOCATION (your Google Cloud location, e.g., us-central1)

These variables are automatically picked up by New GoogleGenAI({}).

2. Install Dependencies

You will need langsmith and @google/genai. Note: While openevals examples often use openai, you can define custom evaluators or potentially adapt openevals for @google/genai if it supports custom LLM integrations.

npm install langsmith @google/genai
# If you plan to use openevals for prebuilt evaluators, install it as well.
# npm install openevals

3. Create a LangSmith API Key

Create an API key in LangSmith settings and set LANGSMITH_API_KEY environment variable.

export LANGSMITH_TRACING=true
export LANGSMITH_API_KEY="<your-langsmith-api-key>"

4. Create a Dataset

Datasets define your test inputs and expected outputs.

import { Client } from "langsmith";

const client = new Client();

async function createAndAddExamples() {
  const dataset = await client.createDataset("My GenAI Dataset", {
    description: "Dataset for evaluating @google/genai models.",
  });

  const examples = [
    {
      inputs: { question: "What is the capital of France?" },
      outputs: { answer: "The capital of France is Paris." },
      dataset_id: dataset.id,
    },
    {
      inputs: { question: "Who painted the Mona Lisa?" },
      outputs: { answer: "Leonardo da Vinci painted the Mona Lisa." },
      dataset_id: dataset.id,
    },
  ];

  await client.createExamples(examples);
  console.log("Dataset and examples created successfully.");
}

// Call the function to create your dataset
// createAndAddExamples();

Read the full file on GitHub · 201 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 201 lines · 0 tokens per session scan A 136c9d9cb632

Subscribe to this mod's changes

langsmith_evaluation is a cursor rule published in the GitHub repository yu-iskw/llmops-demo-ts (6 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,786 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.