pub struct RequestPolicy {
pub num_ctx: Option<u32>,
pub num_ctx_field: Option<String>,
pub max_output: Option<u32>,
pub temperature: Option<Temperature>,
pub reject_response_formats: Vec<String>,
pub aux_model: Option<String>,
pub models: BTreeMap<String, ModelLimits>,
}Expand description
The standing request policy a profile declares: the knobs that depend on the model and the endpoint rather than on one turn.
Fields§
§num_ctx: Option<u32>Context window to ask for, at num_ctx_field.
num_ctx_field: Option<String>Where num_ctx goes: options.num_ctx for Ollama’s native shape, n_ctx for llama.cpp’s.
max_output: Option<u32>Hard ceiling on reply tokens, applied to whatever the config asked for.
temperature: Option<Temperature>§reject_response_formats: Vec<String>response_format types this route rejects outright; one is dropped rather than sent to be
refused.
aux_model: Option<String>The cheap model this provider publishes for titles, compaction and judging.
models: BTreeMap<String, ModelLimits>Per-model limits, keyed by the model id.
Implementations§
Source§impl RequestPolicy
impl RequestPolicy
Sourcepub fn limits_for(&self, model: &str) -> ModelLimits
pub fn limits_for(&self, model: &str) -> ModelLimits
The limits in force for model: its own entry where there is one, the profile’s otherwise.
Sourcepub fn rejects_format(&self, kind: &str) -> bool
pub fn rejects_format(&self, kind: &str) -> bool
Does this route refuse this response_format type?
Trait Implementations§
Source§impl Clone for RequestPolicy
impl Clone for RequestPolicy
Source§impl Debug for RequestPolicy
impl Debug for RequestPolicy
Source§impl Default for RequestPolicy
impl Default for RequestPolicy
Source§impl From<&RequestDef> for RequestPolicy
impl From<&RequestDef> for RequestPolicy
Source§fn from(def: &RequestDef) -> Self
fn from(def: &RequestDef) -> Self
Converts to this type from the input type.
Source§impl PartialEq for RequestPolicy
impl PartialEq for RequestPolicy
impl StructuralPartialEq for RequestPolicy
Auto Trait Implementations§
impl Forget for RequestPolicy
impl Freeze for RequestPolicywhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
*const LeafNode<String, ModelLimits> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, ModelLimits)>>: Freeze,
impl Move for RequestPolicy
impl RefUnwindSafe for RequestPolicy
impl Send for RequestPolicywhere
RawVecInner: Send,
NodeRef<Owned, String, ModelLimits, LeafOrInternal>: Send,
BoxRaw<(String, ModelLimits)>: Send,
impl Sync for RequestPolicywhere
RawVecInner: Sync,
NodeRef<Owned, String, ModelLimits, LeafOrInternal>: Sync,
BoxRaw<(String, ModelLimits)>: Sync,
impl Unpin for RequestPolicy
impl UnsafeUnpin for RequestPolicywhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const LeafNode<String, ModelLimits> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, ModelLimits)>>: UnsafeUnpin,
impl UnwindSafe for RequestPolicy
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
Mutably borrows from an owned value. Read more