models
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| BaseResource llmling.config.models Base class for all resource types. |
||
| BaseToolsetConfig llmling.config.models Base configuration for toolsets. |
||
| CLIResource llmling.config.models Resource from CLI command execution. |
||
| CallableResource llmling.config.models Resource from executing a Python callable. |
||
| Config llmling.config.models Root configuration model. |
||
| CustomToolsetConfig llmling.config.models Configuration for custom toolsets. |
||
| EntryPointToolsetConfig llmling.config.models Configuration for entry point toolsets. |
||
| GlobalSettings llmling.config.models Global settings that apply to all components. |
||
| Jinja2Config llmling.config.models Configuration for Jinja2 environment. |
||
| LLMCapabilitiesConfig llmling.config.models Configuration for LLM system capabilities. |
||
| OpenAPIToolsetConfig llmling.config.models Configuration for OpenAPI toolsets. |
||
| PathResource llmling.config.models Resource loaded from a file or URL. |
||
| RepositoryResource llmling.config.models Git repository content. |
||
| SourceResource llmling.config.models Resource from Python source code. |
||
| TextResource llmling.config.models Raw text resource. |
||
| ToolConfig llmling.config.models Configuration for a tool. |
||
| ToolHints llmling.config.models Configuration for tool execution hints. |
||
| WatchConfig llmling.config.models Watch configuration for resources. |
🛈 DocStrings¶
Configuration models for LLMling.
BaseResource
¶
Bases: Schema
Base class for all resource types.
Source code in src/llmling/config/models.py
description
class-attribute
instance-attribute
¶
Human-readable description of the resource.
mime_type
property
¶
Get the MIME type for this resource.
This should be overridden by subclasses that can determine their MIME type. Default is text/plain.
name
class-attribute
instance-attribute
¶
Technical identifier (automatically set from config key during registration).
processors
class-attribute
instance-attribute
¶
processors: list[ProcessingStep] = Field(default_factory=list)
Processing steps to apply when loading this resource.
supports_watching
property
¶
Whether this resource instance supports watching.
type
class-attribute
instance-attribute
¶
Type identifier for this resource.
uri
class-attribute
instance-attribute
¶
Canonical URI for this resource, set during registration if unset.
watch
class-attribute
instance-attribute
¶
watch: WatchConfig | None = None
Configuration for file system watching, if supported.
get_watch_path
¶
is_templated
¶
is_watched
¶
validate_resource
¶
Validate resource at runtime.
This validation is intentionally separated from Pydantic's model validation to handle: - Remote resources and URLs - Template/placeholder paths that don't exist during config loading - Resources that may become available after config loading - Validation of actual resource availability separate from config structure
Returns:
| Type | Description |
|---|---|
list[str]
|
List of validation warnings (empty if all valid) |
Source code in src/llmling/config/models.py
BaseToolsetConfig
¶
CLIResource
¶
Bases: BaseResource
Resource from CLI command execution.
Source code in src/llmling/config/models.py
command
instance-attribute
¶
Command to execute (string or sequence of arguments).
cwd
class-attribute
instance-attribute
¶
Working directory for command execution.
shell
class-attribute
instance-attribute
¶
Whether to run the command through a shell.
timeout
class-attribute
instance-attribute
¶
Maximum time in seconds to wait for command completion.
type
class-attribute
instance-attribute
¶
Discriminator field identifying this as a CLI-based resource.
validate_command
¶
validate_command() -> CLIResource
Validate command configuration.
Source code in src/llmling/config/models.py
CallableResource
¶
Bases: BaseResource
Resource from executing a Python callable.
Source code in src/llmling/config/models.py
keyword_args
class-attribute
instance-attribute
¶
Keyword arguments to pass to the callable.
type
class-attribute
instance-attribute
¶
Discriminator field identifying this as a callable-based resource.
is_templated
¶
Callable resources are templated if they take parameters.
Source code in src/llmling/config/models.py
validate_import_path
¶
validate_import_path() -> CallableResource
Validate that the import path is properly formatted.
Source code in src/llmling/config/models.py
Config
¶
Bases: ConfigModel
Root configuration model.
Source code in src/llmling/config/models.py
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 | |
context_processors
class-attribute
instance-attribute
¶
context_processors: dict[str, ProcessorConfig] = Field(default_factory=dict)
Content processors available for resource transformation.
global_settings
class-attribute
instance-attribute
¶
global_settings: GlobalSettings = Field(default_factory=GlobalSettings)
Global settings that apply to all components.
prompts
class-attribute
instance-attribute
¶
Prompt definitions keyed by name.
resource_groups
class-attribute
instance-attribute
¶
Groups of resources for logical organization.
resources
class-attribute
instance-attribute
¶
Resource definitions keyed by name.
tools
class-attribute
instance-attribute
¶
tools: dict[str, ToolConfig] = Field(default_factory=dict)
Tool definitions keyed by name.
toolsets
class-attribute
instance-attribute
¶
Toolset configurations for extensible tool collections.
version
class-attribute
instance-attribute
¶
Version string for this configuration format.
from_file
classmethod
¶
Load configuration from YAML file.
This function only handles the basic loading and model validation. For full validation and management, use ConfigManager.load() instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
JoinablePathLike
|
Path to configuration file |
required |
Returns:
| Type | Description |
|---|---|
Self
|
Loaded configuration |
Raises:
| Type | Description |
|---|---|
ConfigError
|
If loading fails |
Source code in src/llmling/config/models.py
validate_references
¶
validate_references() -> Config
Validate all references between components.
Source code in src/llmling/config/models.py
CustomToolsetConfig
¶
Bases: BaseToolsetConfig
Configuration for custom toolsets.
Source code in src/llmling/config/models.py
EntryPointToolsetConfig
¶
Bases: BaseToolsetConfig
Configuration for entry point toolsets.
Source code in src/llmling/config/models.py
GlobalSettings
¶
Bases: ConfigModel
Global settings that apply to all components.
Source code in src/llmling/config/models.py
extra_paths
class-attribute
instance-attribute
¶
Additional import paths
jinja_environment
class-attribute
instance-attribute
¶
jinja_environment: Jinja2Config = Field(default_factory=Jinja2Config)
Jinja2 environment configuration
llm_capabilities
class-attribute
instance-attribute
¶
llm_capabilities: LLMCapabilitiesConfig = Field(default_factory=LLMCapabilitiesConfig)
Control which system capabilities are exposed to LLMs.
log_level
class-attribute
instance-attribute
¶
Log level for LLMling core.
max_retries
class-attribute
instance-attribute
¶
Maximum number of retries for failed operations
pip_index_url
class-attribute
instance-attribute
¶
Alternative PyPI index URL for package installation
prefer_uv
class-attribute
instance-attribute
¶
Explicitely use uv for package installation / management
requirements
class-attribute
instance-attribute
¶
List of package requirments for the functions used in this file.
scripts
class-attribute
instance-attribute
¶
PEP723 scripts (can be imported and will be scanned for dependencies)
timeout
class-attribute
instance-attribute
¶
Maximum time in seconds to wait for operations
Jinja2Config
¶
Bases: ConfigModel
Configuration for Jinja2 environment.
See: https://jinja.palletsprojects.com/en/3.1.x/api/#jinja2.Environment
Source code in src/llmling/config/models.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
block_end_string
class-attribute
instance-attribute
¶
String denoting the end of a block (default: '%}').
block_start_string
class-attribute
instance-attribute
¶
String denoting the beginning of a block (default: '{%').
comment_end_string
class-attribute
instance-attribute
¶
String denoting the end of a comment (default: '#}').
comment_start_string
class-attribute
instance-attribute
¶
String denoting the beginning of a comment (default: '{#').
extensions
class-attribute
instance-attribute
¶
List of Jinja2 extensions to load (e.g., 'jinja2.ext.do').
filters
class-attribute
instance-attribute
¶
Custom filters as mapping of names to import paths.
globals
class-attribute
instance-attribute
¶
Global variables available to all templates.
keep_trailing_newline
class-attribute
instance-attribute
¶
Preserve the trailing newline when rendering templates.
line_comment_prefix
class-attribute
instance-attribute
¶
Prefix that begins a line-based comment.
line_statement_prefix
class-attribute
instance-attribute
¶
Prefix that begins a line-based statement (e.g., '#' for line statements).
lstrip_blocks
class-attribute
instance-attribute
¶
Remove leading spaces and tabs from the start of a line to a block.
newline_sequence
class-attribute
instance-attribute
¶
Sequence that starts a newline (default: ' ').
tests
class-attribute
instance-attribute
¶
Custom tests as mapping of names to import paths.
trim_blocks
class-attribute
instance-attribute
¶
Remove first newline after a block (affects whitespace control).
undefined
class-attribute
instance-attribute
¶
Behavior when accessing undefined variables (default, strict, debug, chainable).
variable_end_string
class-attribute
instance-attribute
¶
String denoting the end of a variable (default: '}}').
variable_start_string
class-attribute
instance-attribute
¶
String denoting the beginning of a variable (default: '{{').
create_environment_kwargs
¶
Convert config to Jinja2 environment kwargs.
Creates a dictionary of kwargs for jinja2.Environment with proper conversion of special values.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict of kwargs for jinja2.Environment constructor |
Raises:
| Type | Description |
|---|---|
ValueError
|
If filter or test imports fail |
Source code in src/llmling/config/models.py
LLMCapabilitiesConfig
¶
Bases: ConfigModel
Configuration for LLM system capabilities.
Source code in src/llmling/config/models.py
chain_tools
class-attribute
instance-attribute
¶
Whether the LLM gains capability to chain multiple tool calls into one.
get_resources
class-attribute
instance-attribute
¶
Whether the LLM can discover available resources.
install_package
class-attribute
instance-attribute
¶
Whether the LLM can install new Python packages for future tools.
load_resource
class-attribute
instance-attribute
¶
Whether the LLM can load and access resource content.
register_code_tool
class-attribute
instance-attribute
¶
Whether the LLM can create new tools from provided Python code.
register_tool
class-attribute
instance-attribute
¶
Whether the LLM can register importable functions as new tools.
OpenAPIToolsetConfig
¶
Bases: BaseToolsetConfig
Configuration for OpenAPI toolsets.
Source code in src/llmling/config/models.py
base_url
class-attribute
instance-attribute
¶
Optional base URL for API requests, overrides the one in spec.
spec
class-attribute
instance-attribute
¶
URL or path to the OpenAPI specification document.
type
class-attribute
instance-attribute
¶
Discriminator field identifying this as an OpenAPI toolset.
PathResource
¶
Bases: BaseResource
Resource loaded from a file or URL.
Source code in src/llmling/config/models.py
supports_watching
property
¶
Whether this resource instance supports watching.
type
class-attribute
instance-attribute
¶
Discriminator field identifying this as a path-based resource.
watch
class-attribute
instance-attribute
¶
watch: WatchConfig | None = None
Configuration for watching the file for changes.
get_watch_path
¶
is_templated
¶
validate_resource
¶
Check if path exists for local files.
Source code in src/llmling/config/models.py
RepositoryResource
¶
Bases: BaseResource
Git repository content.
Source code in src/llmling/config/models.py
SourceResource
¶
Bases: BaseResource
Resource from Python source code.
Source code in src/llmling/config/models.py
import_path
instance-attribute
¶
Dotted import path to the Python module or object.
include_tests
class-attribute
instance-attribute
¶
Whether to include test files and directories.
recursive
class-attribute
instance-attribute
¶
Whether to include submodules recursively.
type
class-attribute
instance-attribute
¶
Discriminator field identifying this as a source code resource.
validate_import_path
¶
validate_import_path() -> SourceResource
Validate that the import path is properly formatted.
Source code in src/llmling/config/models.py
TextResource
¶
Bases: BaseResource
Raw text resource.
Source code in src/llmling/config/models.py
type
class-attribute
instance-attribute
¶
Discriminator field identifying this as a text-based resource.
ToolConfig
¶
Bases: ConfigModel
Configuration for a tool.
Source code in src/llmling/config/models.py
description
class-attribute
instance-attribute
¶
Optional override for the tool's description
hints
class-attribute
instance-attribute
¶
Hints about the tool's behavior and execution characteristics
import_path
instance-attribute
¶
Import path to the tool implementation (e.g. 'mymodule.tools.MyTool')
name
class-attribute
instance-attribute
¶
Optional override for the tool's display name
ToolHints
¶
Bases: ConfigModel
Configuration for tool execution hints.
Source code in src/llmling/config/models.py
destructive
class-attribute
instance-attribute
¶
Hints that this tool performs destructive operations that cannot be undone
idempotent
class-attribute
instance-attribute
¶
Hints that this tool has idempotent behaviour
open_world
class-attribute
instance-attribute
¶
Hints that this tool can access / interact with external resources beyond the current system
read_only
class-attribute
instance-attribute
¶
Hints that this tool only reads data without modifying anything
WatchConfig
¶
Bases: ConfigModel
Watch configuration for resources.