pynydus.config¶
Nydus configuration from environment variables and .env files.
A .env file in the current directory (or any parent) is loaded
automatically via python-dotenv so that both the CLI and the SDK
honour the same file without manual export commands.
LLM (refinement / LLM tiers):
NYDUS_LLM_TYPE:provider/model(e.g.anthropic/claude-3-5-haiku-20241022)NYDUS_LLM_API_KEY: API key for that tier
Both must be set together to enable NydusConfig.llm. If only one is set,
- func:
load_configraisesValueError.
Nest registry (push / pull / FROM nydus/...):
NYDUS_REGISTRY_URL: base URL of the Nest server (e.g.http://localhost:8000)NYDUS_REGISTRY_AUTHOR: optional default author for pushes
Module Contents¶
Classes¶
Nest registry connection settings. |
|
Top-level Nydus configuration loaded from the environment. |
Functions¶
Load |
|
Build an LLM tier config from |
|
Build a registry config from |
API¶
- class pynydus.config.RegistryConfig(/, **data: typing.Any)¶
Bases:
pydantic.BaseModelNest registry connection settings.
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.
- class pynydus.config.NydusConfig(/, **data: typing.Any)¶
Bases:
pydantic.BaseModelTop-level Nydus configuration loaded from the environment.
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- llm: pynydus.llm.models.LLMTierConfig | None¶
None
LLM provider, model, and API key. Required for refinement when set.
- registry: pynydus.config.RegistryConfig | None¶
None
Nest registry connection settings. Required for push/pull when set.
- pynydus.config.load_config() pynydus.config.NydusConfig¶
Load
NydusConfigfromNYDUS_*environment variables.A
.envfile is loaded first (if present) so that CLI commands and the SDK pick up the same configuration without manualexport. Existing environment variables take precedence over.envvalues.Returns: Validated configuration. Missing LLM or registry env vars yield
Nonefor those sections (no error).Raises: ValueError: If
NYDUS_LLM_TYPEandNYDUS_LLM_API_KEYare partially set, or ifNYDUS_LLM_TYPEis malformed.
- pynydus.config._llm_from_env() pynydus.llm.models.LLMTierConfig | None¶
Build an LLM tier config from
NYDUS_LLM_*env vars, orNoneif unset.Raises: ValueError: If only one of type/key is set, or if the type format is invalid.
- pynydus.config._registry_from_env() pynydus.config.RegistryConfig | None¶
Build a registry config from
NYDUS_REGISTRY_*env vars, orNoneif unset.