llm

A code rule requiring the project’s language-model requests to use its DSPy inference module. DSPy is a Python tool for defining and running language-model tasks, including tasks that use tools.

In plain words
What is it for?
Use it when adding or changing code that sends requests to a language model, with or without tool use.
Why use it?
It keeps model calls in one supported path and preserves the project’s built-in monitoring of those calls.

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/edison-watch/custom-mcps/llm
Clone the repo
git clone --depth 1 https://github.com/Edison-Watch/Custom-MCPs

Made for: Cursor.

Per session 311 This file is loaded in full into every session.
When invoked 311 The same file — it is already loaded in full.
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 $0.00311 $0.00311
Opus 5 $0.00156 $0.00156
Sonnet 5 $0.00062 $0.00062
Haiku 4.5 $0.00031 $0.00031

Measured yesterday against content hash c3bd73c5a602, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

llm 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 yesterday.

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/llm.mdc · 57 lines

What it actually says

For LLM inference in the codebase, you should use dspy inference module, like below. This is already supported with native observability.

If you pass tools, it will figure out how to use the tools, otherwise, will run normal LLM inference.

from utils.llm.dspy_inference import DSPYInference
import dspy
import asyncio

class ExtractInfo(dspy.Signature):
    """Extract structured information from text."""

    text: str = dspy.InputField()
    title: str = dspy.OutputField()
    headings: list[str] = dspy.OutputField()
    entities: list[dict[str, str]] = dspy.OutputField(
        desc="a list of entities and their metadata"
    )


def web_search_tool(query: str) -> str:
    """Search the web for information."""
    return "example search term"


# Inference without tool-use
inf_module = DSPYInference(
    pred_signature=ExtractInfo,
    # implicitly, tools=[]
)


# Inference with tool-use
inf_module_with_tool_use = DSPYInference(
    pred_signature=ExtractInfo,
    tools=[web_search],
)


result = asyncio.run(inf_module.run(
    text="Apple Inc. announced its latest iPhone 14 today."
    "The CEO, Tim Cook, highlighted its new features in a press release."
))

print(result.title)
print(result.headings)
print(result.entities)
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. yesterday First seen · 57 lines · 311 tokens per session scan A c3bd73c5a602

Subscribe to this mod's changes

llm is a cursor rule published in the GitHub repository Edison-Watch/Custom-MCPs (0 stars, last pushed 2d ago), licensed MIT. It adds 311 tokens to every session, about $0.0016 per session on Opus 5. 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-08-31.