Skip to content

AI Optimization

Three ways to optimize with AI:

  • Auto-flags — At launch, graphsignal-run --auto-flags fetches engine startup flags from Graphsignal and sets them on the command before the workload starts.
  • Optimize chat — In the Graphsignal app, ask questions about a selected time window and get flag and config guidance from profiling data.
  • graphsignal-context — In your IDE, an AI coding agent uses a small skill and CLI to fetch profiles, errors, and traces for a time range and help you find root causes.

Use any combination: auto-flags for continuous flag tuning at deploy time; Optimize chat when you are already in the dashboard; graphsignal-context when you want an agent in your IDE.


--auto-flags is an opt-in flag on graphsignal-run. Before launch, it sends your command line, engine, platform, and GPU info to Graphsignal, receives engine flags, and sets them on the command.

Terminal window
export GRAPHSIGNAL_API_KEY="..."
graphsignal-run --auto-flags vllm serve <model>
graphsignal-run --auto-flags sglang serve --model-path <model>

When a prior run of the same base command has enough telemetry, Graphsignal’s optimization agent chooses flags based on traffic, GPU profiles, metrics, and other profiling data, coupled with official recipes for models and hardware. New flags are appended; flags you already set are replaced. If the request fails, the workload starts with your original command unchanged.

Typical loop:

  1. Launch with graphsignal-run --auto-flags ... and let the service run under real (or synthetic) load.
  2. Restart with the same base command and --auto-flags again — Graphsignal can set improved flags from the previous run.
  3. Repeat as you change models, hardware, or traffic.

Log in to Graphsignal and open Optimize chat from Operations, Metrics, Tracing, or Errors (or use Optimize with AI on a profile tile). The chat is scoped to the view and time range you have selected, so you can ask about latency, GPU utilization, errors, or startup flags without leaving the dashboard.

Sessions are saved under Optimize. Use this when you want an interactive investigation in the app; use auto-flags when you want Graphsignal to set engine flags automatically at the next launch.


Use your AI coding agent (Claude Code, Codex, or Gemini) to investigate Graphsignal data in natural language. Install a small skill and CLI so the agent can run graphsignal-context signals for a time range and get profiles, errors, and traces. You can then ask the agent to find the root cause of latency spikes, explain failures, or identify bottlenecks—without leaving your IDE or copying data by hand.

The graphsignal-context repo provides a skill so your AI coding agent can fetch Graphsignal signal context for a time range via the graphsignal-context CLI—useful when optimizing inference, profiles, or errors.

Claude Code — Clone the repo into Claude’s personal skills directory:

Terminal window
git clone https://github.com/graphsignal/graphsignal-context ~/.claude/skills/graphsignal-context

Other agents (Codex, Gemini) — Use the skills.sh registry:

Terminal window
npx skills add graphsignal/graphsignal-context

Install the CLI so the agent can run it: uv tool install graphsignal-context, then graphsignal-context login with an API key.

  • Claude Code — Use with Claude Code (e.g. via Claude CLI or supported IDEs).
  • Codex — Use with Codex agent workflows.
  • Gemini CLI — Use with Gemini from the command line.

Once the skill is installed, the agent can run graphsignal-context signals for a time range and use the returned signal context (profiles, errors, traces) to help you optimize. Example prompts:

  • Find the root cause of the latency spike — e.g. “Fetch Graphsignal data for the last 2 hours and find the root cause of the latency spike” or “What’s causing the slowdown? Use Graphsignal signal context from 10am to noon today.”
  • Explain errors or failures — e.g. “Get signal context for the last 24 hours and summarize any errors or failures” or “Why did inference fail around 3pm? Pull Graphsignal data for that window.”
  • Inspect profiles and bottlenecks — e.g. “Fetch Graphsignal context for yesterday and identify the main performance bottlenecks” or “Which operations are taking the most time? Use Graphsignal data from the last 6 hours.”

The agent will call graphsignal-context signals --start <ISO> --end <ISO> (and optional --tags if you specify deployment or service tags), then analyze the returned signal context to answer your question.