entity.infrastructure package
- class entity.infrastructure.AdaptiveLLMInfrastructure(preferred_models=None, benchmark_timeout=10.0, min_tokens_per_second=20.0, **kwargs)[source]
Bases:
BaseInfrastructureAdaptive LLM infrastructure with automatic backend selection.
This infrastructure automatically detects GPU acceleration capabilities and selects the best available model backend for optimal performance.
- Parameters:
- __init__(preferred_models=None, benchmark_timeout=10.0, min_tokens_per_second=20.0, **kwargs)[source]
Initialize adaptive LLM infrastructure.
- Parameters:
preferred_models (List[ModelConfig] | None) – List of model configurations in order of preference
benchmark_timeout (float) – Timeout for performance benchmarking in seconds
min_tokens_per_second (float) – Minimum acceptable tokens/second performance
**kwargs – Additional arguments passed to BaseInfrastructure
- class entity.infrastructure.BaseInfrastructure(version=None)[source]
Bases:
ABCCommon functionality for infrastructure components.
- Parameters:
version (str | None)
- abstractmethod async health_check()[source]
Return
Trueif the infrastructure is healthy.- Return type:
- version = '0.1'
- class entity.infrastructure.DuckDBInfrastructure(file_path, pool_size=5, version=None)[source]
Bases:
BaseInfrastructureLayer 1 infrastructure for managing a DuckDB database file.
- class entity.infrastructure.HarmonyOSSInfrastructure(model_path, reasoning_level='medium', temperature=0.7, max_tokens=2000)[source]
Bases:
BaseInfrastructureInfrastructure adapter for GPT-OSS models using harmony format.
This adapter: - Formats prompts using the harmony multi-role structure - Parses multi-channel responses (analysis, commentary, final) - Maintains role hierarchy for proper context - Integrates with Entity’s LLM infrastructure protocol
- __init__(model_path, reasoning_level='medium', temperature=0.7, max_tokens=2000)[source]
Initialize the Harmony OSS Infrastructure.
- class entity.infrastructure.LocalStorageInfrastructure(base_path, version=None)[source]
Bases:
BaseInfrastructureLayer 1 infrastructure for storing files on the local filesystem.
- class entity.infrastructure.OllamaInfrastructure(base_url, model, version=None)[source]
Bases:
BaseInfrastructureLayer 1 infrastructure for communicating with an Ollama server.
- __init__(base_url, model, version=None)[source]
Configure the client base URL, model, and installer settings.
- class entity.infrastructure.S3Infrastructure(bucket, version=None)[source]
Bases:
BaseInfrastructureLayer 1 infrastructure for interacting with an S3 bucket.
- class entity.infrastructure.DatabaseInfrastructure(*args, **kwargs)[source]
Bases:
ProtocolProtocol for database infrastructure implementations.
- __init__(*args, **kwargs)
- class entity.infrastructure.VectorStoreInfrastructure(*args, **kwargs)[source]
Bases:
ProtocolProtocol for vector store infrastructure implementations.
- __init__(*args, **kwargs)
- class entity.infrastructure.StorageInfrastructure(*args, **kwargs)[source]
Bases:
ProtocolProtocol for storage infrastructure implementations.
- __init__(*args, **kwargs)
Submodules
- entity.infrastructure.base module
- entity.infrastructure.config_models module
- entity.infrastructure.local_storage_infra module
- entity.infrastructure.ollama_infra module
- entity.infrastructure.protocols module
DatabaseInfrastructureVectorStoreInfrastructureStorageInfrastructureStorageInfrastructure.startup()StorageInfrastructure.shutdown()StorageInfrastructure.health_check()StorageInfrastructure.resolve()StorageInfrastructure.read()StorageInfrastructure.write()StorageInfrastructure.delete()StorageInfrastructure.exists()StorageInfrastructure.list_files()StorageInfrastructure.__init__()
- entity.infrastructure.s3_infrastructure module