How grafana/grafana-llm-app works
Grafana LLM is a Grafana app plugin paired with the @grafana/llm client library. The user configures an LLM provider and optional vector services in the app; applications then use the client library to reach the plugin for chat and health checks. The app also exposes model and MCP-tool views, with a development sandbox for exercising tools. The README documents provider, vector, and MCP capabilities; several backend connections are not shown in sampled code, so those links are dashed and unverified.
Main entry points: AppConfig.tsx Plugin configuration · service.go Vector service · Vector.tsx Vector settings · DevSandbox.tsx Developer sandbox
Components 28
Grafana app UI
- Plugin configuration
packages/grafana-llm-app/src/components/AppConfig/AppConfig.tsx - Provider settings
packages/grafana-llm-app/src/components/AppConfig/LLMConfig.tsx - Model settings
packages/grafana-llm-app/src/components/AppConfig/ModelConfig.tsx - Health check UI
packages/grafana-llm-app/src/components/AppConfig/HealthCheck.tsx - Vector settings
packages/grafana-llm-app/src/components/AppConfig/Vector.tsx - Vector credentials
packages/grafana-llm-app/src/components/AppConfig/AuthSettings/BasicAuth.tsx - Developer sandbox
packages/grafana-llm-app/src/components/AppConfig/DevSandbox/DevSandbox.tsx - Sandbox chat
packages/grafana-llm-app/src/components/AppConfig/DevSandbox/DevSandboxChat.tsx - Tool inspector
packages/grafana-llm-app/src/components/AppConfig/DevSandbox/DevSandboxToolInspector.tsx - Tool parameter form
packages/grafana-llm-app/src/components/AppConfig/DevSandbox/ToolParameterForm.tsx - Plugin main page
packages/grafana-llm-app/src/pages/MainPage.tsx - Models view
packages/grafana-llm-app/src/pages/Models.tsx - MCP tools view
packages/grafana-llm-app/src/pages/MCPTools.tsx
Plugin backend
- Plugin app
packages/grafana-llm-app/pkg/plugin/app.go - LLM providers
packages/grafana-llm-app/pkg/plugin/llm_provider.go - Plugin resources
packages/grafana-llm-app/pkg/plugin/resources.go - Chat streaming
packages/grafana-llm-app/pkg/plugin/stream.go - MCP live server
packages/grafana-llm-app/pkg/mcp/live_server.go
Client library
- LLM API client
packages/grafana-llm-frontend/src/llm.ts - MCP client transport
packages/grafana-llm-frontend/src/mcp.tsx
Vector features
- Vector service
packages/grafana-llm-app/pkg/plugin/vector/service.go - Vector embedding
packages/grafana-llm-app/pkg/plugin/vector/embed/openai.go - Qdrant store
packages/grafana-llm-app/pkg/plugin/vector/store/qdrant.go - Grafana Vector API
packages/grafana-llm-app/pkg/plugin/vector/store/vectorapi.go
Other components
- Grafana operator
- Grafana application
- Grafana plugin API
- Configured LLM service
Connections 25
- Grafana operator → Plugin configuration: configures
- Plugin configuration → Provider settings: renders
packages/grafana-llm-app/src/components/AppConfig/AppConfig.tsx - Plugin configuration → Model settings: renders
packages/grafana-llm-app/src/components/AppConfig/AppConfig.tsx - Plugin configuration → Health check UI: shows results
packages/grafana-llm-app/src/components/AppConfig/AppConfig.tsx - Plugin configuration → Vector settings: renders
packages/grafana-llm-app/src/components/AppConfig/AppConfig.tsx - Vector settings → Vector credentials: renders
packages/grafana-llm-app/src/components/AppConfig/Vector.tsx - Provider settings → Developer sandbox: renders
packages/grafana-llm-app/src/components/AppConfig/LLMConfig.tsx - Developer sandbox → Sandbox chat: renders
packages/grafana-llm-app/src/components/AppConfig/DevSandbox/DevSandbox.tsx - Developer sandbox → Tool inspector: renders
packages/grafana-llm-app/src/components/AppConfig/DevSandbox/DevSandbox.tsx - Tool inspector → Tool parameter form: renders
packages/grafana-llm-app/src/components/AppConfig/DevSandbox/DevSandboxToolInspector.tsx - Plugin main page → Models view: renders
packages/grafana-llm-app/src/pages/MainPage.tsx - Plugin main page → MCP tools view: renders
packages/grafana-llm-app/src/pages/MainPage.tsx - Grafana application → LLM API client: calls
packages/grafana-llm-frontend/src/llm.ts - LLM API client → Grafana plugin API: requests chat and health
packages/grafana-llm-frontend/src/llm.ts - Grafana plugin API → Plugin resources: routes requests
- Plugin resources → LLM providers: uses provider
- LLM providers → Configured LLM service: requests completions
- Plugin resources → Chat streaming: streams responses
- Grafana application → MCP client transport: uses
packages/grafana-llm-frontend/src/mcp.tsx - MCP client transport → Grafana plugin API: connects through live transport
- Grafana plugin API → MCP live server: dispatches MCP
- Vector settings → Vector service: configures
- Vector service → Vector embedding: embeds
- Vector service → Qdrant store: uses store
- Vector service → Grafana Vector API: uses store