pub enum GrokModel {
Grok45,
Grok43,
Grok420Reasoning,
Grok420NonReasoning,
Grok420MultiAgent,
GrokBuild01,
Custom(String),
}Expand description
Grok models available for completion
These are convenience variants for common Grok models. For the latest available models and their identifiers, check the xAI Models Documentation.
§Using Custom Models
You can specify any model name as a string using Custom variant or FromStr:
use rstructor::GrokModel;
use std::str::FromStr;
// Using Custom variant
let model = GrokModel::Custom("grok-custom".to_string());
// Using FromStr (useful for config files)
let model = GrokModel::from_str("grok-custom").unwrap();
// Or use the convenience method
let model = GrokModel::from_string("grok-custom");Variants§
Grok45
Grok 4.5 (latest recommended chat and coding model)
Grok43
Grok 4.3 (previous recommended chat model, multimodal text + image input)
Grok420Reasoning
Grok 4.20 Reasoning (reasoning-optimized variant)
Grok420NonReasoning
Grok 4.20 Non-Reasoning (lower-latency non-reasoning variant)
Grok420MultiAgent
Grok 4.20 Multi-Agent (agentic multi-agent variant)
GrokBuild01
Grok Build 0.1 (coding-optimized model; supersedes grok-code-fast-1)
Custom(String)
Custom model identifier — for new models, local LLMs, or provider-compatible endpoints not covered by a named variant.
Implementations§
Trait Implementations§
impl Eq for Model
impl StructuralPartialEq for Model
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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