ifixkart-backend/swarm/config.py

44 lines
1.6 KiB
Python

"""
@config SwarmConfig (swarm/config.py)
@purpose Central configuration for Swarm Intelligence Engine.
"""
import os
from pydantic import BaseModel
class SwarmSettings(BaseModel):
# Execution & Concurrency
MAX_CONCURRENT_SIMULATIONS: int = 2
JOB_TIMEOUT_SECONDS: int = 120
HEARTBEAT_TIMEOUT_SECONDS: int = 60
ZOMBIE_REAP_MINUTES: int = 3
# Default Provider: "mock", "gemini", or "openai"
DEFAULT_PROVIDER: str = os.getenv("SWARM_LLM_PROVIDER", "mock")
# API Keys
GEMINI_API_KEY: str = os.getenv("GEMINI_API_KEY", "")
OPENAI_API_KEY: str = os.getenv("OPENAI_API_KEY", "")
OPENAI_BASE_URL: str = os.getenv("OPENAI_BASE_URL", "https://api.openai.com/v1")
# Models
GEMINI_MODEL: str = os.getenv("GEMINI_MODEL", "gemini-2.0-flash")
OPENAI_MODEL: str = os.getenv("OPENAI_MODEL", "gpt-4o-mini")
# Token Pricing Matrices (USD per 1,000,000 tokens)
PRICING_MATRIX: dict = {
"gemini-2.0-flash": {"input_per_million": 0.10, "output_per_million": 0.40},
"gpt-4o-mini": {"input_per_million": 0.15, "output_per_million": 0.60},
"mock": {"input_per_million": 0.0, "output_per_million": 0.0},
}
# Archetype Parameters
DEFAULT_AGENT_COUNT: int = 50
EPISTEMIC_DISCLAIMER: str = (
"Simulated customer behavior represents an exploratory AI hypothesis calibrated against historical "
"store observations. Agent-to-agent variance reflects model sensitivity and hypothesis dispersion—it "
"does not constitute guaranteed real-world customer behavior."
)
swarm_settings = SwarmSettings()