config
config
¶
Configuration loading, hardware detection, and engine recommendation.
User configuration lives at ~/.diapason/config.toml. load_config()
detects hardware, fills sensible defaults, then overlays any user overrides
found in the TOML file.
Classes¶
ConfigurationError
¶
Bases: RuntimeError
Raised when the resolved home directory would violate isolation guarantees.
GpuInfo
dataclass
¶
GpuInfo(
vendor: str = "",
name: str = "",
vram_gb: float = 0.0,
compute_capability: str = "",
count: int = 0,
)
Detected GPU metadata.
HardwareInfo
dataclass
¶
HardwareInfo(
platform: str = "",
cpu_brand: str = "",
cpu_count: int = 0,
ram_gb: float = 0.0,
gpu: Optional[GpuInfo] = None,
)
Detected system hardware.
OllamaEngineConfig
dataclass
¶
Per-engine config for Ollama.
VLLMEngineConfig
dataclass
¶
Per-engine config for vLLM.
SGLangEngineConfig
dataclass
¶
Per-engine config for SGLang.
LlamaCppEngineConfig
dataclass
¶
Per-engine config for llama.cpp.
MLXEngineConfig
dataclass
¶
Per-engine config for MLX.
LMStudioEngineConfig
dataclass
¶
Per-engine config for LM Studio.
ExoEngineConfig
dataclass
¶
Per-engine config for Exo.
NexaEngineConfig
dataclass
¶
Per-engine config for Nexa.
UzuEngineConfig
dataclass
¶
Per-engine config for Uzu.
AppleFmEngineConfig
dataclass
¶
Per-engine config for Apple Foundation Models.
GemmaCppEngineConfig
dataclass
¶
GemmaCppEngineConfig(
model_path: str = "",
tokenizer_path: str = "",
model_type: str = "",
num_threads: int = 0,
)
Per-engine config for gemma.cpp.
LemonadeEngineConfig
dataclass
¶
Per-engine config for Lemonade.
EngineConfig
dataclass
¶
EngineConfig(
default: str = "ollama",
ollama: OllamaEngineConfig = OllamaEngineConfig(),
vllm: VLLMEngineConfig = VLLMEngineConfig(),
sglang: SGLangEngineConfig = SGLangEngineConfig(),
llamacpp: LlamaCppEngineConfig = LlamaCppEngineConfig(),
mlx: MLXEngineConfig = MLXEngineConfig(),
lmstudio: LMStudioEngineConfig = LMStudioEngineConfig(),
exo: ExoEngineConfig = ExoEngineConfig(),
nexa: NexaEngineConfig = NexaEngineConfig(),
uzu: UzuEngineConfig = UzuEngineConfig(),
apple_fm: AppleFmEngineConfig = AppleFmEngineConfig(),
gemma_cpp: GemmaCppEngineConfig = GemmaCppEngineConfig(),
lemonade: LemonadeEngineConfig = LemonadeEngineConfig(),
)
Inference engine settings with nested per-engine configs.
Attributes¶
IntelligenceConfig
dataclass
¶
IntelligenceConfig(
default_model: str = "",
fallback_model: str = "",
light_model: str = "",
num_ctx: int = 0,
checkpoint_path: str = "",
quantization: str = "none",
preferred_engine: str = "",
provider: str = "",
temperature: float = 0.7,
max_tokens: int = 1024,
top_p: float = 0.9,
top_k: int = 40,
repetition_penalty: float = 1.0,
stop_sequences: str = "",
)
The model — identity, paths, quantization, and generation defaults.
DeepResearchConfig
dataclass
¶
Planner settings for the web Deep Research endpoint.
RoutingLearningConfig
dataclass
¶
Routing sub-policy config within Learning.
SFTConfig
dataclass
¶
SFTConfig(
model_name: str = "Qwen/Qwen3-1.7B",
max_seq_length: int = 4096,
num_epochs: int = 3,
batch_size: int = 8,
learning_rate: float = 2e-05,
weight_decay: float = 0.01,
warmup_ratio: float = 0.1,
max_grad_norm: float = 1.0,
gradient_checkpointing: bool = True,
use_lora: bool = True,
lora_rank: int = 16,
lora_alpha: int = 32,
lora_dropout: float = 0.05,
target_modules: str = "q_proj,v_proj",
use_4bit: bool = False,
checkpoint_dir: str = "checkpoints/sft",
min_pairs: int = 10,
agent_filter: str = "",
)
General-purpose SFT training config. Maps to [learning.intelligence.sft].
GRPOConfig
dataclass
¶
GRPOConfig(
model_name: str = "Qwen/Qwen3-1.7B",
max_seq_length: int = 4096,
max_response_length: int = 2048,
num_epochs: int = 10,
batch_size: int = 16,
learning_rate: float = 1e-06,
max_grad_norm: float = 1.0,
gradient_checkpointing: bool = True,
num_samples_per_prompt: int = 8,
temperature: float = 1.0,
kl_coef: float = 0.0001,
clip_ratio: float = 0.2,
use_8bit_ref: bool = True,
checkpoint_dir: str = "checkpoints/grpo",
save_every_n_epochs: int = 1,
keep_last_n: int = 3,
min_prompts: int = 10,
agent_filter: str = "",
)
General-purpose GRPO training config. Maps to [learning.intelligence.grpo].
DSPyOptimizerConfig
dataclass
¶
DSPyOptimizerConfig(
optimizer: str = "BootstrapFewShotWithRandomSearch",
task_lm: str = "",
teacher_lm: str = "",
max_bootstrapped_demos: int = 4,
max_labeled_demos: int = 4,
num_candidate_programs: int = 10,
max_rounds: int = 1,
optimize_system_prompt: bool = True,
optimize_few_shot: bool = True,
optimize_tool_descriptions: bool = True,
min_traces: int = 20,
metric_threshold: float = 0.7,
agent_filter: str = "",
config_dir: str = "",
)
DSPy agent optimizer config. Maps to [learning.agent.dspy].
GEPAOptimizerConfig
dataclass
¶
GEPAOptimizerConfig(
reflection_lm: str = "",
max_metric_calls: int = 150,
population_size: int = 10,
optimize_system_prompt: bool = True,
optimize_tools: bool = True,
optimize_max_turns: bool = True,
optimize_temperature: bool = True,
min_traces: int = 20,
assessment_batch_size: int = 10,
agent_filter: str = "",
config_dir: str = "",
)
GEPA agent optimizer config. Maps to [learning.agent.gepa].
ACEOptimizerConfig
dataclass
¶
ACEOptimizerConfig(
generator_model: str = "",
reflector_model: str = "",
curator_model: str = "",
api_provider: str = "openai",
num_epochs: int = 1,
max_num_rounds: int = 3,
eval_steps: int = 100,
playbook_token_budget: int = 80000,
max_tokens: int = 4096,
save_dir: str = "",
task_name: str = "diapason",
min_traces: int = 20,
agent_filter: str = "",
config_dir: str = "",
)
ACE agent optimizer config. Maps to [learning.agent.ace].
ACE (Agentic Context Engineering) evolves a playbook — annotated natural-language strategies that get prepended to the agent's context — using a Generator / Reflector / Curator triad. Unlike DSPy (few-shot bootstrapping) or GEPA (Pareto-evolutionary prompt mutation), ACE writes a textual playbook that the agent reads at inference time.
See https://github.com/ace-agent/ace for the upstream reference.
Install via pip install -e diapason[learning-ace] once the
optional dep is available (ACE is not on PyPI as of v1.0.1; the
extra installs from the upstream git repo).
IntelligenceLearningConfig
dataclass
¶
IntelligenceLearningConfig(
policy: str = "none",
sft: SFTConfig = SFTConfig(),
grpo: GRPOConfig = GRPOConfig(),
)
Intelligence sub-policy config within Learning.
AgentLearningConfig
dataclass
¶
AgentLearningConfig(
policy: str = "none",
dspy: DSPyOptimizerConfig = DSPyOptimizerConfig(),
gepa: GEPAOptimizerConfig = GEPAOptimizerConfig(),
ace: ACEOptimizerConfig = ACEOptimizerConfig(),
)
Agent sub-policy config within Learning.
SkillsLearningConfig
dataclass
¶
SkillsLearningConfig(
auto_optimize: bool = False,
optimizer: str = "dspy",
min_traces_per_skill: int = 20,
optimization_interval_seconds: int = 86400,
overlay_dir: str = (
lambda: str(
get_config_dir() / "learning" / "skills"
)
)(),
)
Configuration for the skills learning loop (Plan 2A).
MetricsConfig
dataclass
¶
MetricsConfig(
accuracy_weight: float = 0.6,
latency_weight: float = 0.2,
cost_weight: float = 0.1,
efficiency_weight: float = 0.1,
)
Reward / optimization metric weights.
SpecSearchCompositeRewardConfig
dataclass
¶
SpecSearchCompositeRewardConfig(
alpha: float = 0.5,
beta: float = 0.1,
gamma: float = 0.1,
delta: float = 0.3,
)
Composite reward weights for Intelligence-edit training (paper Eq. 1).
R(q, y) = alpha * R_acc - beta * E_hat - gamma * L_hat - delta * C_hat
SpecSearchLearningConfig
dataclass
¶
SpecSearchLearningConfig(
enabled: bool = False,
teacher_model: str = "claude-opus-4-6",
teacher_engine: str = "cloud",
autonomy_mode: str = "tiered",
min_traces: int = 20,
max_cost_per_session_usd: float = 5.0,
max_tool_calls_per_diagnosis: int = 30,
stagnation_k: int = 5,
max_total_cost_usd: float = 50.0,
stagnation_eps: float = 0.001,
max_regression: float = 0.01,
min_improvement: float = 0.0,
benchmark_subsample_size: int = 50,
benchmark_version: str = "personal_v1",
composite_reward: SpecSearchCompositeRewardConfig = SpecSearchCompositeRewardConfig(),
)
LLM-guided spec search config (paper §3.3, Algorithm 1).
Maps to [learning.spec_search] and is consumed by
SpecSearchOrchestrator.from_config and SpecSearchLoop.
LearningConfig
dataclass
¶
LearningConfig(
enabled: bool = False,
update_interval: int = 100,
auto_update: bool = False,
routing: RoutingLearningConfig = RoutingLearningConfig(),
intelligence: IntelligenceLearningConfig = IntelligenceLearningConfig(),
agent: AgentLearningConfig = AgentLearningConfig(),
skills: SkillsLearningConfig = SkillsLearningConfig(),
spec_search: SpecSearchLearningConfig = SpecSearchLearningConfig(),
metrics: MetricsConfig = MetricsConfig(),
training_enabled: bool = False,
training_schedule: str = "",
min_improvement: float = 0.02,
)
StorageConfig
dataclass
¶
StorageConfig(
default_backend: str = "sqlite",
db_path: str = (
lambda: str(get_config_dir() / "memory.db")
)(),
context_top_k: int = 5,
context_min_score: float = 0.0,
context_max_tokens: int = 2048,
chunk_size: int = 512,
chunk_overlap: int = 64,
enabled: bool = False,
backend: str = "local",
extraction_model: str = "",
max_facts: int = 1000,
facts_path: str = (
lambda: str(get_config_dir() / "memory_facts.jsonl")
)(),
)
Storage (memory) backend settings.
Covers both the retrieval/document store (default_backend, db_path,
chunking, context injection) and the automatic long-term memory service
(enabled, backend, extraction_model, max_facts,
facts_path) configured under [memory] in config.toml.
MCPConfig
dataclass
¶
MCP (Model Context Protocol) settings.
BrowserConfig
dataclass
¶
BrowserConfig(
headless: bool = True,
timeout_ms: int = 30000,
viewport_width: int = 1280,
viewport_height: int = 720,
)
Browser automation settings (Playwright).
ToolsConfig
dataclass
¶
ToolsConfig(
storage: StorageConfig = StorageConfig(),
mcp: MCPConfig = MCPConfig(),
browser: BrowserConfig = BrowserConfig(),
enabled: str = "",
ville: str = "",
)
Tools primitive settings — wraps storage and MCP configuration.
AgentConfig
dataclass
¶
AgentConfig(
default_agent: str = "simple",
max_turns: int = 10,
tools: str = "",
objective: str = "",
system_prompt: str = "",
system_prompt_path: str = "",
context_from_memory: bool = True,
trousse_adaptative: bool = False,
tool_approval: str = "ask",
default_system_prompt: str = "You are Diapason, a helpful AI assistant running locally on the user's own hardware. You are not a cloud service, and you are not Claude, ChatGPT, Gemini, or any other branded assistant. If asked who or what you are, identify yourself as Diapason. Respond helpfully, concisely, and accurately.",
)
ServerConfig
dataclass
¶
ServerConfig(
host: str = "127.0.0.1",
port: int = 8000,
agent: str = "orchestrator",
model: str = "",
workers: int = 1,
cors_origins: list = (
lambda: [
"http://localhost:3000",
"http://localhost:5173",
"http://localhost:5174",
"http://127.0.0.1:3000",
"http://127.0.0.1:5173",
"http://127.0.0.1:5174",
"tauri://localhost",
"http://tauri.localhost",
"https://tauri.localhost",
]
)(),
)
API server settings.
TelemetryConfig
dataclass
¶
TelemetryConfig(
enabled: bool = True,
db_path: str = (
lambda: str(get_config_dir() / "telemetry.db")
)(),
gpu_metrics: bool = False,
gpu_poll_interval_ms: int = 50,
energy_vendor: str = "",
warmup_samples: int = 0,
steady_state_window: int = 5,
steady_state_threshold: float = 0.05,
)
Telemetry persistence settings.
AnalyticsConfig
dataclass
¶
AnalyticsConfig(
enabled: bool = False,
host: str = "https://34.231.106.201.sslip.io",
key: str = "phc_ysKu72QaxzYNmDpHFcesD2ZZAe68zkdWJEKoYYkc5e3n",
anon_id_path: str = (
lambda: str(get_config_dir() / "anon_id")
)(),
flush_interval_seconds: int = 30,
flush_at_size: int = 100,
)
External anonymous usage analytics (PostHog).
Separate concern from :class:TelemetryConfig, which stores local
FLOPs/energy/inference metrics in SQLite. This controls anonymized
usage events sent to the Diapason team's PostHog instance to
measure setup success, retention, feature usage, and churn.
No chat content, prompts, model outputs, file paths, emails, IPs,
or hardware identifiers are ever sent. See docs/telemetry.md.
TracesConfig
dataclass
¶
TracesConfig(
enabled: bool = True,
db_path: str = (
lambda: str(get_config_dir() / "traces.db")
)(),
)
Trace system settings.
ProactiveConfig
dataclass
¶
ProactiveConfig(
enabled: bool = False,
schedule: str = "0 5 * * *",
hours_back: int = 24,
timezone: str = "",
notification_channel: str = "",
)
Proactive agent — autonomous action scheduling and approval routing.
TelegramChannelConfig
dataclass
¶
TelegramChannelConfig(
bot_token: str = "",
allowed_chat_ids: str = "",
parse_mode: str = "Markdown",
)
Per-channel config for Telegram.
DiscordChannelConfig
dataclass
¶
Per-channel config for Discord.
SlackChannelConfig
dataclass
¶
Per-channel config for Slack.
WebhookChannelConfig
dataclass
¶
Per-channel config for generic webhooks.
EmailChannelConfig
dataclass
¶
EmailChannelConfig(
smtp_host: str = "",
smtp_port: int = 587,
imap_host: str = "",
imap_port: int = 993,
username: str = "",
password: str = "",
use_tls: bool = True,
)
Per-channel config for email (SMTP/IMAP).
WhatsAppChannelConfig
dataclass
¶
Per-channel config for WhatsApp Cloud API.
SignalChannelConfig
dataclass
¶
Per-channel config for Signal (via signal-cli REST API).
GoogleChatChannelConfig
dataclass
¶
Per-channel config for Google Chat webhooks.
IRCChannelConfig
dataclass
¶
IRCChannelConfig(
server: str = "",
port: int = 6667,
nick: str = "",
password: str = "",
use_tls: bool = False,
)
Per-channel config for IRC.
TeamsChannelConfig
dataclass
¶
Per-channel config for Microsoft Teams (Bot Framework).
MatrixChannelConfig
dataclass
¶
Per-channel config for Matrix.
MattermostChannelConfig
dataclass
¶
Per-channel config for Mattermost.
FeishuChannelConfig
dataclass
¶
Per-channel config for Feishu (Lark).
BlueBubblesChannelConfig
dataclass
¶
Per-channel config for BlueBubbles (iMessage bridge).
WhatsAppBaileysChannelConfig
dataclass
¶
WhatsAppBaileysChannelConfig(
auth_dir: str = "",
assistant_name: str = "Diapason",
assistant_has_own_number: bool = False,
)
Per-channel config for WhatsApp via Baileys protocol.
ChannelConfig
dataclass
¶
ChannelConfig(
enabled: bool = False,
default_channel: str = "",
default_agent: str = "simple",
telegram: TelegramChannelConfig = TelegramChannelConfig(),
discord: DiscordChannelConfig = DiscordChannelConfig(),
slack: SlackChannelConfig = SlackChannelConfig(),
webhook: WebhookChannelConfig = WebhookChannelConfig(),
email: EmailChannelConfig = EmailChannelConfig(),
whatsapp: WhatsAppChannelConfig = WhatsAppChannelConfig(),
signal: SignalChannelConfig = SignalChannelConfig(),
google_chat: GoogleChatChannelConfig = GoogleChatChannelConfig(),
irc: IRCChannelConfig = IRCChannelConfig(),
webchat: WebChatChannelConfig = WebChatChannelConfig(),
teams: TeamsChannelConfig = TeamsChannelConfig(),
matrix: MatrixChannelConfig = MatrixChannelConfig(),
mattermost: MattermostChannelConfig = MattermostChannelConfig(),
feishu: FeishuChannelConfig = FeishuChannelConfig(),
bluebubbles: BlueBubblesChannelConfig = BlueBubblesChannelConfig(),
whatsapp_baileys: WhatsAppBaileysChannelConfig = WhatsAppBaileysChannelConfig(),
)
Channel messaging settings.
CapabilitiesConfig
dataclass
¶
RBAC capability system settings.
SecurityConfig
dataclass
¶
SecurityConfig(
enabled: bool = True,
scan_input: bool = True,
scan_output: bool = True,
mode: str = "redact",
secret_scanner: bool = True,
pii_scanner: bool = True,
audit_log_path: str = (
lambda: str(get_config_dir() / "audit.db")
)(),
enforce_tool_confirmation: bool = True,
merkle_audit: bool = True,
signing_key_path: str = "",
ssrf_protection: bool = True,
rate_limit_enabled: bool = True,
rate_limit_rpm: int = 60,
rate_limit_burst: int = 10,
local_engine_bypass: bool = False,
local_tool_bypass: bool = False,
profile: str = "personal",
vault_key_path: str = (
lambda: str(get_config_dir() / ".vault_key")
)(),
capabilities: CapabilitiesConfig = CapabilitiesConfig(),
)
Security guardrails settings.
SandboxConfig
dataclass
¶
SandboxConfig(
enabled: bool = False,
image: str = "diapason-sandbox:latest",
timeout: int = 300,
workspace: str = "",
mount_allowlist_path: str = "",
max_concurrent: int = 5,
runtime: str = "docker",
wasm_fuel_limit: int = 1000000,
wasm_memory_limit_mb: int = 256,
)
Container sandbox settings.
SchedulerConfig
dataclass
¶
Task scheduler settings.
HeartbeatConfig
dataclass
¶
HeartbeatConfig(
enabled: bool = False,
interval_seconds: int = 1800,
workspace_dir: str = "",
speak: bool = False,
notify: bool = True,
quiet_hours_enabled: bool = True,
quiet_hours_start: str = "22:00",
quiet_hours_end: str = "07:00",
tool_allowlist: str = "digest_collect,memory_search,think,calendar_query",
)
Ambient HEARTBEAT.md queue drain (Diapason-style).
ReflexionConfig
dataclass
¶
Le brouillon-critique des questions analytiques (server/reflexion.py).
model vide = le modèle du tour se relit lui-même ; un nom de modèle
("qwen3:14b") fait monter ces tours-là en gamme. Choisir un modèle qui
COHABITE en mémoire avec celui du quotidien, sinon chaque question
analytique évince le modèle de la voix et tout le monde attend.
RoutinesConfig
dataclass
¶
RoutinesConfig(
enabled: bool = True,
path: str = "",
state_path: str = "",
catchup_grace: bool = True,
max_catchup_hours: int = 2,
allow_shell: bool = False,
)
Named cron routines catalog (ROUTINES.json).
WorkflowConfig
dataclass
¶
Workflow engine settings.
SessionConfig
dataclass
¶
SessionConfig(
enabled: bool = False,
max_age_hours: float = 24.0,
consolidation_threshold: int = 100,
db_path: str = (
lambda: str(get_config_dir() / "sessions.db")
)(),
)
Cross-channel session settings.
A2AConfig
dataclass
¶
Agent-to-Agent protocol settings.
OperatorsConfig
dataclass
¶
OperatorsConfig(
enabled: bool = False,
manifests_dir: str = (
lambda: str(get_config_dir() / "operators")
)(),
auto_activate: str = "",
)
Operator lifecycle settings.
VoiceRealtimeConfig
dataclass
¶
VoiceRealtimeConfig(
enabled: bool = True,
provider: str = "local",
model: str = "",
voice: str = "",
language: str = "",
enable_tools: bool = True,
max_tool_steps: int = 12,
stt_model: str = "",
tools: str = "",
voice_lock: bool = True,
)
Duplex realtime voice (local pipeline / Gemini Live / OpenAI Realtime).
WakeWordConfig
dataclass
¶
WakeWordConfig(
enabled: bool = False,
backend: str = "phrase_gate",
phrases: str = "diapason, hey diapason, dis diapason",
action: str = "talk",
cooldown_s: float = 2.5,
sensitivity: float = 0.5,
device: str = "",
model_path: str = "",
require_local_only: bool = True,
text_gate: bool = True,
)
Always-on / text-gate wake word (opt-in; local only).
DesktopVisionConfig
dataclass
¶
DesktopVisionConfig(
enabled: bool = False,
monitor: int = 1,
max_dimension: int = 1280,
allow_cloud: bool = False,
engine: str = "",
model: str = "",
redact: bool = False,
keep_temp: bool = False,
rate_limit_ms: int = 1500,
share_interval_s: float = 5.0,
share_max_minutes: float = 30.0,
)
Screen capture / share → vision model (opt-in).
DesktopLightningConfig
dataclass
¶
DesktopLightningConfig(
enabled: bool = True,
min_confidence: float = 0.9,
allow_open: bool = True,
allow_type: bool = True,
allow_external_drafts: bool = True,
allow_remote: bool = False,
focus_timeout_s: float = 2.0,
app_cache_ttl_s: float = 300.0,
verify_actions: bool = True,
preload_model: bool = True,
)
Fast deterministic desktop execution before any model call.
DesktopConfig
dataclass
¶
DesktopConfig(
lightning: DesktopLightningConfig = DesktopLightningConfig(),
vision: DesktopVisionConfig = DesktopVisionConfig(),
)
Desktop automation / vision settings.
SpeechConfig
dataclass
¶
SpeechConfig(
backend: str = "auto",
model: str = "base",
language: str = "",
device: str = "auto",
compute_type: str = "float16",
realtime: VoiceRealtimeConfig = VoiceRealtimeConfig(),
wakeword: WakeWordConfig = WakeWordConfig(),
)
Speech-to-text settings.
DictationConfig
dataclass
¶
DictationConfig(
polish: bool = True,
dictionary: bool = True,
dictionary_path: str = "",
llm_polish: bool = False,
email_mode: str = "off",
llm_timeout_ms: int = 2000,
paste_to_frontmost: bool = True,
hotkey: str = "Cmd+Alt+Space",
ptt_hold: bool = True,
voice_commands: bool = True,
auto_learn: bool = True,
)
Push-to-talk dictation polish + dictionary (Diapason-style).
OptimizeConfig
dataclass
¶
OptimizeConfig(
max_trials: int = 20,
early_stop_patience: int = 5,
optimizer_model: str = "claude-sonnet-4-6",
optimizer_provider: str = "anthropic",
benchmark: str = "",
max_samples: int = 50,
judge_model: str = "gpt-5-mini-2025-08-07",
db_path: str = (
lambda: str(get_config_dir() / "optimize.db")
)(),
)
Configuration optimization settings.
AgentManagerConfig
dataclass
¶
AgentManagerConfig(
enabled: bool = True,
db_path: str = (
lambda: str(get_config_dir() / "agents.db")
)(),
)
Persistent agent manager settings.
MemoryFilesConfig
dataclass
¶
MemoryFilesConfig(
soul_path: str = (
lambda: str(get_config_dir() / "SOUL.md")
)(),
memory_path: str = (
lambda: str(get_config_dir() / "MEMORY.md")
)(),
user_path: str = (
lambda: str(get_config_dir() / "USER.md")
)(),
nudge_interval: int = 10,
persona_name: str = "",
)
Persistent memory-file paths and nudge settings.
SystemPromptConfig
dataclass
¶
SystemPromptConfig(
prefix: str = "",
soul_max_chars: int = 4000,
memory_max_chars: int = 2500,
user_max_chars: int = 1500,
skill_desc_max_chars: int = 60,
truncation_strategy: str = "head_tail",
)
Limits and strategy for system-prompt assembly.
CompressionConfig
dataclass
¶
CompressionConfig(
enabled: bool = True,
threshold: float = 0.5,
strategy: str = "session_consolidation",
)
Configuration for context compression.
SkillSourceConfig
dataclass
¶
SkillSourceConfig(
source: str = "",
url: str = "",
filter: Dict[str, Any] = dict(),
auto_update: bool = False,
)
Configuration for a single skill source (Hermes, OpenClaw, GitHub).
SkillsConfig
dataclass
¶
SkillsConfig(
enabled: bool = True,
skills_dir: str = (
lambda: str(get_config_dir() / "skills")
)(),
active: str = "*",
auto_discover: bool = True,
auto_sync: bool = False,
nudge_interval: int = 15,
index_repo: str = "https://github.com/diapason/skill-index.git",
index_dir: str = (
lambda: str(get_config_dir() / "skill-index")
)(),
max_depth: int = 5,
sandbox_dangerous: bool = True,
sources: List[SkillSourceConfig] = list(),
)
Configuration for agent-authored procedural skills.
DigestSectionConfig
dataclass
¶
DigestSectionConfig(
sources: List[str] = list(),
max_items: int = 10,
priority_contacts: List[str] = list(),
)
Configuration for a single digest section.
DigestConfig
dataclass
¶
DigestConfig(
enabled: bool = False,
schedule: str = "0 6 * * *",
timezone: str = "",
persona: str = "diapason",
sections: List[str] = (
lambda: ["messages", "calendar", "health", "world"]
)(),
optional_sections: List[str] = (
lambda: ["github", "financial", "music", "fitness"]
)(),
honorific: str = "sir",
voice_id: str = "",
voice_speed: float = 1.0,
tts_backend: str = "cartesia",
messages: DigestSectionConfig = (
lambda: DigestSectionConfig(
sources=["gmail", "slack", "google_tasks"]
)
)(),
calendar: DigestSectionConfig = (
lambda: DigestSectionConfig(sources=["gcalendar"])
)(),
health: DigestSectionConfig = (
lambda: DigestSectionConfig(
sources=["oura", "apple_health"]
)
)(),
world: DigestSectionConfig = (
lambda: DigestSectionConfig(sources=[])
)(),
)
Configuration for the morning digest feature.
MeshConfig
dataclass
¶
Le maillage d'appareils, et ce qu'il chiffre.
chiffrement gouverne l'ÉMISSION seulement, et cette asymétrie est
voulue :
opportuniste(défaut) — on scelle vers un pair dont on détient une clé fraîche, et l'on part en clair vers les autres. C'est ce qui laisse le client mobile fonctionner : il ne publie aucune clé.exige— on refuse d'envoyer à un pair sans clé fraîche. Cela rend le téléphone injoignable, et il faut le savoir avant de le choisir.jamais— le comportement d'avant le 26 août 2026, pour revenir en arrière sans rien désinstaller.
EN RÉCEPTION, le clair est accepté quel que soit ce réglage. Non par
négligence : /v1/mesh/commands/deliver est l'une des cinq portes du
téléphone, et le client figé y poste une enveloppe claire. Rendre
exige symétrique casserait net un appareil déjà déployé. Sans cette
phrase, quelqu'un croirait raisonnablement que sa machine n'accepte plus
de clair.
PrivacyConfig
dataclass
¶
The single, authoritative answer to "may this leave the machine?".
Before this section existed the question was asked in three unrelated places, each covering one path and none covering the rest:
speech.wakeword.require_local_only— declared, never read anywhere.desktop.vision.allow_cloud— vision only.- nothing at all for speech-to-text or for LLM polish, which is how a failing local Whisper silently reached OpenAI and how dictation polish reached a cloud engine.
A promise that is enforced on some paths and not others is not a promise.
local_only is therefore checked by every outbound path, and the
per-domain switches may only ever be more restrictive than it — never
less. Turning local_only on cannot be overridden by any of them.
New installations default to True. Existing cloud setups can opt in
explicitly by setting local_only = false under [privacy].
DiapasonConfig
dataclass
¶
DiapasonConfig(
installed_at: str = "",
installer_version: str = "",
hardware: HardwareInfo = HardwareInfo(),
engine: EngineConfig = EngineConfig(),
intelligence: IntelligenceConfig = IntelligenceConfig(),
deep_research: DeepResearchConfig = DeepResearchConfig(),
learning: LearningConfig = LearningConfig(),
tools: ToolsConfig = ToolsConfig(),
agent: AgentConfig = AgentConfig(),
server: ServerConfig = ServerConfig(),
telemetry: TelemetryConfig = TelemetryConfig(),
analytics: AnalyticsConfig = AnalyticsConfig(),
traces: TracesConfig = TracesConfig(),
channel: ChannelConfig = ChannelConfig(),
security: SecurityConfig = SecurityConfig(),
mesh: MeshConfig = MeshConfig(),
privacy: PrivacyConfig = PrivacyConfig(),
sandbox: SandboxConfig = SandboxConfig(),
scheduler: SchedulerConfig = SchedulerConfig(),
heartbeat: HeartbeatConfig = HeartbeatConfig(),
reflexion: ReflexionConfig = ReflexionConfig(),
routines: RoutinesConfig = RoutinesConfig(),
workflow: WorkflowConfig = WorkflowConfig(),
sessions: SessionConfig = SessionConfig(),
a2a: A2AConfig = A2AConfig(),
operators: OperatorsConfig = OperatorsConfig(),
speech: SpeechConfig = SpeechConfig(),
desktop: DesktopConfig = DesktopConfig(),
dictation: DictationConfig = DictationConfig(),
optimize: OptimizeConfig = OptimizeConfig(),
agent_manager: AgentManagerConfig = AgentManagerConfig(),
memory_files: MemoryFilesConfig = MemoryFilesConfig(),
system_prompt: SystemPromptConfig = SystemPromptConfig(),
compression: CompressionConfig = CompressionConfig(),
skills: SkillsConfig = SkillsConfig(),
digest: DigestConfig = DigestConfig(),
proactive: ProactiveConfig = ProactiveConfig(),
mining: Optional["MiningConfig"] = None,
)
Top-level configuration for Diapason.
Attributes¶
memory
property
writable
¶
memory: StorageConfig
Backward-compatible accessor — canonical location is tools.storage.
Functions:¶
get_cache_dir
¶
Resolve the directory for regenerable caches (eval datasets, etc.).
Lives at <root>/cache so caches stay inside the single Diapason
directory instead of scattering across ~/.cache.
Source code in src/diapason/core/paths.py
get_config_dir
¶
Resolve Diapason' single root directory, honoring env overrides.
Precedence: $DIAPASON_HOME > $XDG_DATA_HOME/diapason >
~/.diapason. The result is always absolute and is rejected if it
falls inside the Diapason source tree.
Source code in src/diapason/core/paths.py
get_config_path
¶
get_data_dir
¶
Resolve the directory for persistent data (databases, blobs, …).
Consolidated under the single root; identical to :func:get_config_dir.
Provided as a distinct name so call sites read intentionally.
Source code in src/diapason/core/paths.py
detect_hardware
¶
detect_hardware() -> HardwareInfo
Auto-detect hardware capabilities with graceful fallbacks.
Source code in src/diapason/core/config.py
recommend_engine
¶
recommend_engine(hw: HardwareInfo) -> str
Suggest the best inference engine for the detected hardware.
Source code in src/diapason/core/config.py
recommend_model
¶
recommend_model(hw: HardwareInfo, engine: str) -> str
Suggest a default model for the selected engine and hardware.
For Lemonade, prefer the validated Qwen3.6 35B A3B GGUF default. For other local engines, use the generic Qwen3.5 tier mapping.
Source code in src/diapason/core/config.py
estimated_download_gb
¶
apply_security_profile
¶
apply_security_profile(
security_cfg: "SecurityConfig",
server_cfg: "ServerConfig | None",
*,
overrides: "set[str] | None" = None,
) -> None
Expand a named security profile into config fields.
Fields in overrides (explicitly set by the user in TOML) are not overwritten by the profile.
Source code in src/diapason/core/config.py
validate_config_key
¶
Validate a dotted config key and return the leaf field's Python type.
Raises :class:ValueError when the key does not map to a known field.
The function walks the DiapasonConfig dataclass hierarchy using
dataclasses.fields().
Examples::
validate_config_key("engine.ollama.host") # -> str
validate_config_key("intelligence.temperature") # -> float
Source code in src/diapason/core/config.py
1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 | |
load_config
cached
¶
load_config(path: Optional[Path] = None) -> DiapasonConfig
Detect hardware, build defaults, overlay TOML overrides.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
Explicit config file. If not set, uses
TYPE:
|
Source code in src/diapason/core/config.py
2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 | |
generate_minimal_toml
¶
generate_minimal_toml(
hw: HardwareInfo,
engine: str | None = None,
*,
host: str | None = None,
) -> str
Render a minimal TOML config with only essential settings.
Source code in src/diapason/core/config.py
generate_default_toml
¶
generate_default_toml(
hw: HardwareInfo,
engine: str | None = None,
*,
host: str | None = None,
) -> str
Render a commented TOML string suitable for ~/.diapason/config.toml.
Source code in src/diapason/core/config.py
2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 | |