pub struct CreateModelRequest {
pub model_name: String,
pub match_pattern: String,
pub start_date: Option<Option<String>>,
pub unit: Option<ModelUsageUnit>,
pub input_price: Option<Option<f64>>,
pub output_price: Option<Option<f64>>,
pub total_price: Option<Option<f64>>,
pub pricing_tiers: Option<Option<Vec<PricingTierInput>>>,
pub tokenizer_id: Option<Option<String>>,
pub tokenizer_config: Option<Option<Value>>,
}Fields§
§model_name: StringName of the model definition. If multiple with the same name exist, they are applied in the following order: (1) custom over built-in, (2) newest according to startTime where model.startTime<observation.startTime
match_pattern: StringRegex pattern which matches this model definition to generation.model. Useful in case of fine-tuned models. If you want to exact match, use (?i)^modelname$
start_date: Option<Option<String>>Apply only to generations which are newer than this ISO date.
unit: Option<ModelUsageUnit>§input_price: Option<Option<f64>>Deprecated. Use ‘pricingTiers’ instead. Price (USD) per input unit. Creates a default tier if pricingTiers not provided.
output_price: Option<Option<f64>>Deprecated. Use ‘pricingTiers’ instead. Price (USD) per output unit. Creates a default tier if pricingTiers not provided.
total_price: Option<Option<f64>>Deprecated. Use ‘pricingTiers’ instead. Price (USD) per total units. Cannot be set if input or output price is set. Creates a default tier if pricingTiers not provided.
pricing_tiers: Option<Option<Vec<PricingTierInput>>>Optional. Array of pricing tiers for this model. Use pricing tiers for all models - both those with threshold-based pricing variations and those with simple flat pricing: - For models with standard flat pricing: Create a single default tier with your prices (e.g., one tier with isDefault=true, priority=0, conditions=[], and your standard prices) - For models with threshold-based pricing: Create a default tier plus additional conditional tiers (e.g., default tier for standard usage + high-volume tier for usage above certain thresholds) Requirements: - Cannot be provided with flat prices (inputPrice/outputPrice/totalPrice) - use one approach or the other - Must include exactly one default tier with isDefault=true, priority=0, and conditions=[] - All tier names and priorities must be unique within the model - Each tier must define at least one price If omitted, you must provide flat prices instead (inputPrice/outputPrice/totalPrice), which will automatically create a single default tier named "Standard".
tokenizer_id: Option<Option<String>>Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
tokenizer_config: Option<Option<Value>>Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
Implementations§
Source§impl CreateModelRequest
impl CreateModelRequest
Sourcepub fn builder() -> CreateModelRequestBuilder
pub fn builder() -> CreateModelRequestBuilder
Create an instance of CreateModelRequest using the builder syntax
Source§impl CreateModelRequest
impl CreateModelRequest
pub fn new(model_name: String, match_pattern: String) -> CreateModelRequest
Trait Implementations§
Source§impl Clone for CreateModelRequest
impl Clone for CreateModelRequest
Source§fn clone(&self) -> CreateModelRequest
fn clone(&self) -> CreateModelRequest
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CreateModelRequest
impl Debug for CreateModelRequest
Source§impl Default for CreateModelRequest
impl Default for CreateModelRequest
Source§fn default() -> CreateModelRequest
fn default() -> CreateModelRequest
Source§impl<'de> Deserialize<'de> for CreateModelRequest
impl<'de> Deserialize<'de> for CreateModelRequest
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>,
Source§impl PartialEq for CreateModelRequest
impl PartialEq for CreateModelRequest
Source§impl Serialize for CreateModelRequest
impl Serialize for CreateModelRequest
impl StructuralPartialEq for CreateModelRequest
Auto Trait Implementations§
impl Freeze for CreateModelRequest
impl RefUnwindSafe for CreateModelRequest
impl Send for CreateModelRequest
impl Sync for CreateModelRequest
impl Unpin for CreateModelRequest
impl UnwindSafe for CreateModelRequest
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)