| Crates.io | llm-config-core |
| lib.rs | llm-config-core |
| version | 0.5.0 |
| created_at | 2025-11-21 21:47:12.197092+00 |
| updated_at | 2025-11-21 21:47:12.197092+00 |
| description | Core configuration management library for LLM Config Manager with multi-environment support, versioning, and secret management |
| homepage | https://github.com/globalbusinessadvisors/llm-config-manager |
| repository | https://github.com/globalbusinessadvisors/llm-config-manager |
| max_upload_size | |
| id | 1944322 |
| size | 97,874 |
Core configuration management library for LLM Config Manager with multi-environment support, versioning, and secret management.
Add this to your Cargo.toml:
[dependencies]
llm-config-core = "0.5.0"
tokio = { version = "1", features = ["full"] }
use llm_config_core::{ConfigManager, Environment};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize configuration manager
let config = ConfigManager::new("./config-data").await?;
// Set a configuration value
config.set(
"app.database.url",
"postgres://localhost/mydb",
Environment::Development
).await?;
// Get a configuration value
let db_url = config.get("app.database.url", Environment::Development).await?;
println!("Database URL: {}", db_url);
Ok(())
}
// Store an encrypted secret
config.set_secret(
"app.api.key",
"my-secret-api-key",
Environment::Production
).await?;
// Retrieve and decrypt the secret
let api_key = config.get_secret("app.api.key", Environment::Production).await?;
// Get configuration history
let history = config.get_history("app.database.url").await?;
for version in history {
println!("Version {}: {}", version.version, version.value);
}
// Rollback to previous version
config.rollback("app.database.url", 5).await?;
// Set base configuration
config.set("app.max_connections", "100", Environment::Base).await?;
// Override for production
config.set("app.max_connections", "500", Environment::Production).await?;
// Get with cascade (returns 500 for production, 100 for others)
let max_conns = config.get_with_overrides("app.max_connections", Environment::Production).await?;
The core library is built on:
Benchmarks on modern hardware:
This crate requires Rust 1.75 or later.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
See CONTRIBUTING.md for contribution guidelines.