Store preferences by model profile
This commit is contained in:
@@ -380,7 +380,9 @@ pub(crate) struct EngineDiagnosticSettings {
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
pub(crate) struct RuntimePreferences {
|
||||
pub(crate) execution: ExecutionPreferences,
|
||||
#[serde(skip)]
|
||||
pub(crate) speculative: SpeculativePreferences,
|
||||
#[serde(skip)]
|
||||
pub(crate) ssd: SsdPreferences,
|
||||
pub(crate) steering: SteeringPreferences,
|
||||
pub(crate) diagnostics: DiagnosticPreferences,
|
||||
@@ -505,7 +507,7 @@ pub(crate) struct EngineExecutionSettings {
|
||||
pub(crate) warm_weights: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub(crate) enum ReasoningMode {
|
||||
#[serde(rename = "none")]
|
||||
@@ -530,22 +532,28 @@ impl fmt::Display for ReasoningMode {
|
||||
pub(crate) struct GenerationPreferences {
|
||||
pub(crate) context_tokens: i32,
|
||||
pub(crate) max_generated_tokens: i32,
|
||||
#[serde(skip_serializing, default = "default_system_prompt")]
|
||||
pub(crate) system_prompt: String,
|
||||
pub(crate) temperature: Option<f32>,
|
||||
pub(crate) top_p: Option<f32>,
|
||||
pub(crate) min_p: Option<f32>,
|
||||
pub(crate) seed: Option<u64>,
|
||||
#[serde(skip_serializing)]
|
||||
pub(crate) reasoning_mode: ReasoningMode,
|
||||
}
|
||||
|
||||
pub(crate) const DEFAULT_SYSTEM_PROMPT: &str = "You are an expert coding assistant operating inside DS4Server, a local coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.\n\nGuidelines:\n- Be concise in your responses\n- Show file paths clearly when working with files";
|
||||
|
||||
fn default_system_prompt() -> String {
|
||||
DEFAULT_SYSTEM_PROMPT.into()
|
||||
}
|
||||
|
||||
impl Default for GenerationPreferences {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
context_tokens: 32_768,
|
||||
max_generated_tokens: 50_000,
|
||||
system_prompt: DEFAULT_SYSTEM_PROMPT.into(),
|
||||
system_prompt: default_system_prompt(),
|
||||
temperature: None,
|
||||
top_p: None,
|
||||
min_p: None,
|
||||
|
||||
Reference in New Issue
Block a user