Configuration Reference¶
Use this page for exact config model fields.
All config schemas are pydantic.BaseModel types.
For examples and operational guidance, see Configuration Guide.
- nomad.config.resolve_symbol(dotted_path)¶
Resolve a dotted path to a Python object.
- class nomad.config.TorchModuleConfig(*, model_class, name_or_path, tool_name=None, batch_size=None, **extra_data)¶
Configuration entry for a
nomad.fm_base_tool.TorchModuleTool.- Parameters:
- name_or_path: str¶
Model weights URI or legacy source resolved by
nomad.hub.RepoSpec.
- resolve_spec(*, base_dir=None)¶
Resolve
name_or_pathto a normalized model source specification.- Parameters:
base_dir (TypeAliasForwardRef('pathlib.Path') | None)
- Return type:
- resolve_source(*, base_dir=None)¶
Resolve
name_or_pathto a loadable local path.- Parameters:
base_dir (TypeAliasForwardRef('pathlib.Path') | None)
- Return type:
str | TypeAliasForwardRef(‘pathlib.Path’)
- instantiate(*, base_dir=None, **overrides)¶
Instantiate the configured model class from its configured source.
- Parameters:
base_dir (TypeAliasForwardRef('pathlib.Path') | None)
- Return type:
- build_tool(*, base_dir=None, **overrides)¶
Instantiate the tool and apply name and batching overrides.
- Parameters:
base_dir (TypeAliasForwardRef('pathlib.Path') | None)
- Return type:
- add_to_fastmcp(server, *, base_dir=None)¶
Instantiate and register this model tool on a FastMCP server.
- Parameters:
server (FastMCP)
base_dir (TypeAliasForwardRef('pathlib.Path') | None)
- class nomad.config.ToolConfig(*, tool, name=None, tool_kwargs=None, **extra_data)¶
Configuration entry for a regular Python callable exposed as a tool.
- property fn¶
Resolve and optionally instantiate the configured callable.
- set_name()¶
- add_to_fastmcp(server)¶
Register this callable on a FastMCP server.
- Parameters:
server (FastMCP)
- class nomad.config.ToolManagerConfig(*, enabled=True, idle_seconds=300.0, max_pending_per_tool=None, max_devices_per_tool=None, gc_idle_seconds=300.0, disk_idle_seconds=600.0)¶
Configuration for the optional Torch model tool manager.
- Parameters:
- idle_seconds: float | None¶
Idle seconds before reducing a tool’s device allocation by one slot.
Nonedisables device-slot idle eviction.
- max_devices_per_tool: int | None¶
Maximum device slots one tool may occupy.
Noneuses all managed slots.
- gc_idle_seconds: float | None¶
Server idle seconds before clearing unused Python and accelerator caches.
Nonedisables cache clearing.
- disk_idle_seconds: float | None¶
Tool idle seconds after full offload before dropping the resident instance.
Nonekeeps resident instances loaded.
- instantiate(*, device_provider=None, **overrides)¶
- class nomad.config.TelemetryConfig(*, enabled=None, service_name='nomad', otlp_endpoint=None)¶
OpenTelemetry exporter configuration for
nomad serve.
- class nomad.config.SearchWeights(*, tantivy_score=1.0, name_field=3.0, import_path_field=2.0, title_field=1.5, description_field=1.0, arguments_field=1.25, exact_name=12.0, prefix_name=8.0, suffix_name=4.0, substring_name=2.0)¶
Weights for tool search ranking.
- Parameters:
- class nomad.config.SearchToolConfig(*, expose=False, candidate_limit=50, weights=<factory>)¶
Search behavior and ranking configuration.
- Parameters:
expose (bool)
candidate_limit (int)
weights (SearchWeights)
- weights: SearchWeights¶
Factors controlling search result rankings.
- class nomad.config.ServerConfig(*, context_dir=<factory>, fmod_models=<factory>, tools=<factory>, tool_manager=<factory>, search_tool=<factory>, telemetry=<factory>)¶
Top-level configuration consumed by
nomad serve.- Parameters:
context_dir (pathlib.Path)
fmod_models (list[TorchModuleConfig])
tools (list[ToolConfig])
tool_manager (ToolManagerConfig)
search_tool (SearchToolConfig)
telemetry (TelemetryConfig)
- context_dir: Path¶
Directory used to resolve paths relative to the config file.
- fmod_models: list[TorchModuleConfig]¶
Torch model tools to load and expose.
- tools: list[ToolConfig]¶
Regular Python tools to import and expose.
- tool_manager: ToolManagerConfig¶
Torch model scheduling and device management options.
- search_tool: SearchToolConfig¶
Optional MCP tool discovery settings.
- telemetry: TelemetryConfig¶
OpenTelemetry exporter settings for server metrics and tracing.
- instantiate_model(fmod, **overrides)¶
Instantiate one model entry relative to this config file.
- Parameters:
fmod (TorchModuleConfig)
- Return type:
- build_tool(fmod, **overrides)¶
Instantiate one model entry and apply configured tool overrides.
- Parameters:
fmod (TorchModuleConfig)
- Return type:
- class nomad.gateway.config.SandboxLimits(*, timeout_seconds=30.0, stdout_limit=65536, stderr_limit=65536, result_limit=65536, workspace_root=<factory>)¶
Execution limits applied to sandboxed Python runs.
- Parameters:
- class nomad.gateway.config.GatewayDefaults(*, timeout_seconds=30.0, stdout_limit=65536, stderr_limit=65536, result_limit=65536, workspace_root=<factory>, wrappers_package='mcp_tools')¶
Base defaults merged with per-request overrides.
- Parameters:
- class nomad.gateway.config.MiddlewareConfig(*, kind, options=<factory>)¶
Generic middleware configuration entry.
- class nomad.gateway.config.AllowlistMiddlewareConfig(*, kind='allowlist', options=<factory>, allow=<factory>, deny=<factory>)¶
Allow or deny upstream tools by
server:toolglob patterns.- Parameters:
- kind: Literal['allowlist']¶
Middleware implementation name.
- class nomad.gateway.config.LoggingMiddlewareConfig(*, kind='logging', options=<factory>, level='info')¶
Structured logging middleware configuration.
- Parameters:
- kind: Literal['logging']¶
Middleware implementation name.
- level: Literal['debug', 'info', 'warning', 'error']¶
Log level used for upstream tool invocation records.
- class nomad.gateway.config.RedactionMiddlewareConfig(*, kind='redaction', options=<factory>, mode='basic')¶
Response redaction middleware configuration.
- kind: Literal['redaction']¶
Middleware implementation name.
- mode: Literal['basic', 'none']¶
Redaction mode for upstream tool responses.
- class nomad.gateway.config.TelemetryConfig(*, enabled=None, service_name='nomad-gateway', otlp_endpoint=None)¶
OpenTelemetry exporter configuration for the gateway process.
- class nomad.gateway.config.GatewayConfig(*, servers=<factory>, defaults=<factory>, middleware=<factory>, telemetry=<factory>)¶
Top-level configuration for the MCP gateway.
- Parameters:
servers (dict[str, Annotated[StdioServerParameters | StreamableHttpParameters, BeforeValidator(func=~nomad.gateway.config._validate_server_parameters, json_schema_input_type=PydanticUndefined)] | dict[str, Any]])
defaults (GatewayDefaults)
middleware (Sequence[AllowlistMiddlewareConfig | LoggingMiddlewareConfig | RedactionMiddlewareConfig | MiddlewareConfig])
telemetry (TelemetryConfig)
- servers: dict[str, ServerParameters | dict[str, Any]]¶
Upstream MCP servers keyed by local server ID.
- defaults: GatewayDefaults¶
Default sandbox runtime options.
- middleware: Sequence[MiddlewareEntry]¶
Middleware entries applied to upstream tool calls.
- telemetry: TelemetryConfig¶
OpenTelemetry exporter settings for gateway tracing.
- class nomad.gateway.config.GatewayRuntimeOptions(timeout_seconds, stdout_limit, stderr_limit, result_limit, workspace_root, wrappers_root, wrappers_package, python_executable)¶
Runtime options computed from config and request overrides.
- Parameters:
timeout_seconds (float | None)
stdout_limit (int)
stderr_limit (int)
result_limit (int)
workspace_root (TypeAliasForwardRef('pathlib.Path') | None)
wrappers_root (pathlib.Path)
wrappers_package (str)
python_executable (pathlib.Path)
- wrappers_root: Path¶
- python_executable: Path¶
- classmethod from_defaults_and_overrides(defaults, overrides=None, *, wrappers_root)¶
- Parameters:
defaults (GatewayDefaults)
wrappers_root (pathlib.Path)
- Return type: