pub struct PawanConfig {Show 27 fields
pub provider: LlmProvider,
pub model: String,
pub base_url: Option<String>,
pub dry_run: bool,
pub auto_backup: bool,
pub require_git_clean: bool,
pub bash_timeout_secs: u64,
pub max_file_size_kb: usize,
pub max_tool_iterations: usize,
pub max_context_tokens: usize,
pub system_prompt: Option<String>,
pub temperature: f32,
pub top_p: f32,
pub max_tokens: usize,
pub thinking_budget: usize,
pub max_retries: usize,
pub fallback_models: Vec<String>,
pub max_result_chars: usize,
pub reasoning_mode: bool,
pub healing: HealingConfig,
pub targets: HashMap<String, TargetConfig>,
pub tui: TuiConfig,
pub mcp: HashMap<String, McpServerEntry>,
pub permissions: HashMap<String, ToolPermission>,
pub cloud: Option<CloudConfig>,
pub models: ModelRouting,
pub eruka: ErukaConfig,
}Expand description
Main configuration for Pawan
Fields§
§provider: LlmProviderLLM provider to use
model: StringLLM model to use for coding tasks
base_url: Option<String>Override the API base URL (e.g. “http://localhost:8080/v1” for llama.cpp). Takes priority over OPENAI_API_URL / NVIDIA_API_URL env vars.
dry_run: boolEnable dry-run mode (show changes without applying)
auto_backup: boolCreate backups before editing files
require_git_clean: boolRequire clean git working directory
bash_timeout_secs: u64Timeout for bash commands (seconds)
max_file_size_kb: usizeMaximum file size to read (KB)
max_tool_iterations: usizeMaximum tool iterations per request
max_context_tokens: usizeMaximum context tokens before pruning
system_prompt: Option<String>System prompt override
temperature: f32Temperature for LLM responses
top_p: f32Top-p sampling parameter
max_tokens: usizeMaximum tokens in response
thinking_budget: usizeMaximum tokens allowed for reasoning/thinking (0 = unlimited). When set, pawan tracks thinking vs action token usage per call. If thinking exceeds this budget, a warning is logged.
max_retries: usizeMaximum retries for LLM API calls (429 or 5xx errors)
fallback_models: Vec<String>Fallback models to try when primary model fails
max_result_chars: usizeMaximum characters in tool result before truncation
reasoning_mode: boolEnable reasoning/thinking mode (for DeepSeek/Nemotron models)
healing: HealingConfigHealing configuration
targets: HashMap<String, TargetConfig>Target projects
tui: TuiConfigTUI configuration
mcp: HashMap<String, McpServerEntry>MCP server configurations
permissions: HashMap<String, ToolPermission>Tool permission overrides (tool_name -> permission)
cloud: Option<CloudConfig>Cloud fallback: when primary model fails, fall back to cloud provider. Enables hybrid local+cloud routing.
models: ModelRoutingTask-type model routing: use different models for different task categories. If not set, all tasks use the primary model.
eruka: ErukaConfigEruka context engine integration (3-tier memory injection)
Implementations§
Source§impl PawanConfig
impl PawanConfig
Sourcepub fn apply_env_overrides(&mut self)
pub fn apply_env_overrides(&mut self)
Apply environment variable overrides (PAWAN_MODEL, PAWAN_PROVIDER, etc.)
Sourcepub fn get_target(&self, name: &str) -> Option<&TargetConfig>
pub fn get_target(&self, name: &str) -> Option<&TargetConfig>
Get target by name
Sourcepub fn get_system_prompt(&self) -> String
pub fn get_system_prompt(&self) -> String
Get the system prompt, with optional PAWAN.md context injection
Sourcepub fn use_thinking_mode(&self) -> bool
pub fn use_thinking_mode(&self) -> bool
Check if thinking mode should be enabled. Only applicable to DeepSeek models (other NIM models don’t support thinking tokens).
Trait Implementations§
Source§impl Clone for PawanConfig
impl Clone for PawanConfig
Source§fn clone(&self) -> PawanConfig
fn clone(&self) -> PawanConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PawanConfig
impl Debug for PawanConfig
Source§impl Default for PawanConfig
impl Default for PawanConfig
Source§impl<'de> Deserialize<'de> for PawanConfigwhere
PawanConfig: Default,
impl<'de> Deserialize<'de> for PawanConfigwhere
PawanConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PawanConfig
impl RefUnwindSafe for PawanConfig
impl Send for PawanConfig
impl Sync for PawanConfig
impl Unpin for PawanConfig
impl UnsafeUnpin for PawanConfig
impl UnwindSafe for PawanConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more