pub enum ChatFamily {
ChatMl,
Llama3,
Gemma,
Gemma4,
None,
}Expand description
Chat-template family, detected from the special tokens a model’s vocab carries. Instruct models must have their prompt wrapped in this template (with an assistant-turn cue) or they degenerate (emit EOS immediately, or repeat) — a raw prompt gives the model no “your turn to answer” signal.
Variants§
ChatMl
<|im_start|>role\n…<|im_end|> — Qwen2 / SmolLM2 / many instruct models.
Llama3
<|start_header_id|>role<|end_header_id|>\n\n…<|eot_id|> — Llama-3.x.
Gemma
<start_of_turn>role\n…<end_of_turn> — Gemma 1/2/3 (no system role).
Gemma4
<|turn>role\n…<turn|> — Gemma 4 instruct (also uses <|channel> tool channel).
None
No recognised chat specials — the raw prompt is used unchanged.
Trait Implementations§
Source§impl Clone for ChatFamily
impl Clone for ChatFamily
Source§fn clone(&self) -> ChatFamily
fn clone(&self) -> ChatFamily
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChatFamily
impl Debug for ChatFamily
Source§impl PartialEq for ChatFamily
impl PartialEq for ChatFamily
Source§fn eq(&self, other: &ChatFamily) -> bool
fn eq(&self, other: &ChatFamily) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ChatFamily
impl Eq for ChatFamily
impl StructuralPartialEq for ChatFamily
Auto Trait Implementations§
impl Freeze for ChatFamily
impl RefUnwindSafe for ChatFamily
impl Send for ChatFamily
impl Sync for ChatFamily
impl Unpin for ChatFamily
impl UnsafeUnpin for ChatFamily
impl UnwindSafe for ChatFamily
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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