A declarative framework for LLM resource management, prompts, and tools.
LLMling
A framework for declarative LLM application development focused on resource management, prompt templates, and tool execution.
This package provides the backend for two consumers: A MCP server and a pydantic-AI based Agent
Core Concepts
LLMLing provides a YAML-based configuration system for LLM applications. It allows to set up custom MPC servers serving content defined in YAML files.
- Static Declaration: Define your LLM's environment in YAML - no code required
- MCP Protocol: Built on the Machine Chat Protocol (MCP) for standardized LLM interaction
- Component Types:
- Resources: Content providers (files, text, CLI output, etc.)
- Prompts: Message templates with arguments
- Tools: Python functions callable by the LLM
The YAML configuration creates a complete environment that provides the LLM with:
Access to content via resources
Structured prompts for consistent interaction
Tools for extending capabilities
Written from ground up in modern python (minimum 3.12 required)
100% typed
pydantic(-ai) based
An overview about the whole system:
graph TB
subgraph LLMling[LLMling Core Package]
RT[RuntimeConfig]
subgraph Core_Components[Core Components]
Resources[Resource Management- Load files/URLs- Process content- Watch changes]
Tools[Tool System- Execute functions- Register new tools- OpenAPI integration]
Prompts[Prompt System- Static/Dynamic prompts- Template rendering- Completion support]
end
CLI[Core CLI- config add/remove/list- resource list/load- tool list/execute- prompt list/render]
Core_Components -->|YAML configuration| RT
RT -->|All components| CLI
CLI -->|modify| Core_Components
end
subgraph Direct_Access[mcp-server-llmlingDirect Component Access]
MCP[HTTP/SSE Server- Start/Stop server]
MCP_CLI[Server CLI- Start/Stop server]
Injection[Injection Server- Inject componentsduring runtime]
end
subgraph Function_Access[llmling-agentAccess via Function Calling]
LLM[LLM Integration- Function calling- Resource access- Tool execution- Structured output]
Agent_CLI[Agent CL
Tools (3)
execute_toolExecutes a registered Python function or CLI command defined in the YAML configuration.load_resourceLoads content from a defined resource such as files, URLs, or CLI output.render_promptRenders a message template with provided arguments.Configuration
{"mcpServers": {"llmling": {"command": "llmling-server", "args": ["--config", "/path/to/config.yaml"]}}}