llm-config-core
Core configuration management library for LLM Config Manager with multi-environment support, versioning, and secret management.
Features
- Multi-Environment Support: Manage configurations across dev, staging, production, and custom environments
- Secret Management: Encrypted storage of sensitive configuration values
- Version Control: Track changes and rollback to previous configurations
- Namespace Isolation: Organize configurations by application or service
- Environment Overrides: Cascade configuration values with environment-specific overrides
- Type Safety: Strong typing for configuration values with validation
- Async/Await: Full async support with Tokio runtime
Usage
Add this to your Cargo.toml:
[]
= "0.5.0"
= { = "1", = ["full"] }
Quick Start
use ;
async
Secret Management
// Store an encrypted secret
config.set_secret.await?;
// Retrieve and decrypt the secret
let api_key = config.get_secret.await?;
Version Control
// Get configuration history
let history = config.get_history.await?;
for version in history
// Rollback to previous version
config.rollback.await?;
Environment Overrides
// Set base configuration
config.set.await?;
// Override for production
config.set.await?;
// Get with cascade (returns 500 for production, 100 for others)
let max_conns = config.get_with_overrides.await?;
Architecture
The core library is built on:
- llm-config-storage: Persistent storage backend
- llm-config-crypto: Encryption for secrets
- Sled: Embedded database for fast access
- Tokio: Async runtime for concurrent operations
Performance
Benchmarks on modern hardware:
- Configuration retrieval: ~50 µs
- Configuration updates: ~100 µs
- With encryption: ~120 µs
- Batch operations: ~10,000 ops/sec
Minimum Supported Rust Version
This crate requires Rust 1.75 or later.
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Contributing
See CONTRIBUTING.md for contribution guidelines.