# AiProviderConfig

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-protranslate-studio/struct-aiproviderconfig/

**struct** · [`ferroui-protranslate-studio`](/docs/0.5.0/api/ferroui-protranslate-studio/) · v0.5.0

```rust
struct AiProviderConfig
```

Serializable host configuration. Debug output redacts the API key.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Studio/ai.rs#L85)

## Members

- [`provider`](#struct_field-provider)
- [`api_key`](#struct_field-api_key)
- [`model_id`](#struct_field-model_id)
- [`base_url`](#struct_field-base_url)
- [`is_enabled`](#struct_field-is_enabled)
- [`max_tokens`](#struct_field-max_tokens)
- [`temperature`](#struct_field-temperature)
- [`omit_temperature`](#struct_field-omit_temperature)
- [`legacy_max_tokens`](#struct_field-legacy_max_tokens)
- [`for_provider`](#function-for_provider)
- [`is_configured`](#function-is_configured)
- [`validate`](#function-validate)

<a id="struct_field-provider"></a>

### provider

```rust
provider: AiProvider
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Studio/ai.rs#L86)

<a id="struct_field-api_key"></a>

### api_key

```rust
api_key: String
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Studio/ai.rs#L87)

<a id="struct_field-model_id"></a>

### model_id

```rust
model_id: String
```

Explicit model selection from live discovery or a host-supplied compatible ID.
Empty configurations can discover models but cannot translate.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Studio/ai.rs#L90)

<a id="struct_field-base_url"></a>

### base_url

```rust
base_url: String
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Studio/ai.rs#L91)

<a id="struct_field-is_enabled"></a>

### is_enabled

```rust
is_enabled: bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Studio/ai.rs#L92)

<a id="struct_field-max_tokens"></a>

### max_tokens

```rust
max_tokens: u32
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Studio/ai.rs#L93)

<a id="struct_field-temperature"></a>

### temperature

```rust
temperature: f64
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Studio/ai.rs#L94)

<a id="struct_field-omit_temperature"></a>

### omit_temperature

```rust
omit_temperature: bool
```

Omit the temperature field for models which do not accept sampling parameters.
Enabled by default; opt into sampling only for a model that supports it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Studio/ai.rs#L97)

<a id="struct_field-legacy_max_tokens"></a>

### legacy_max_tokens

```rust
legacy_max_tokens: bool
```

Use max_tokens for older OpenAI-compatible servers; otherwise max_completion_tokens.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Studio/ai.rs#L99)

<a id="function-for_provider"></a>

### for_provider

```rust
fn for_provider(provider: AiProvider) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Studio/ai.rs#L166)

<a id="function-is_configured"></a>

### is_configured

```rust
fn is_configured(self: &Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Studio/ai.rs#L179)

<a id="function-validate"></a>

### validate

```rust
fn validate(self: &Self) -> Result<(), StudioError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/ProTranslate/FerroUI.ProTranslate.Studio/ai.rs#L185)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `DeserializeOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `StructuralPartialEq`
- `PartialEq`
- `Serialize`
- `Debug`
- `Default`
- `Deserialize<'de>`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
