> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# LLM Provider • Rust AI Agent SDK

> LlmProvider: Trait for LLM providers

# LlmProvider

> Defined in the [**LLM**](../modules/llm) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Trait for LLM providers

## Methods

### `chat`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn chat(
        &self,
        messages: &[Message],
        tools: Option<&[ToolDefinition]>,
    ) -> Result<LlmResponse>
```

Send a chat completion request

**Parameters:**

| Name       | Type                              |
| ---------- | --------------------------------- |
| `messages` | `&[Message]`                      |
| `tools`    | `Option&lt;&[ToolDefinition]&gt;` |

### `chat_stream`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn chat_stream(
        &self,
        messages: &[Message],
        tools: Option<&[ToolDefinition]>,
    ) -> Result<Box<dyn futures::Stream<Item = Result<String>> + Send + Unpin>>
```

Stream a chat completion (returns chunks)

**Parameters:**

| Name       | Type                              |
| ---------- | --------------------------------- |
| `messages` | `&[Message]`                      |
| `tools`    | `Option&lt;&[ToolDefinition]&gt;` |

### `model`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn model(&self) -> &str
```

Get the model name

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/llm/mod.rs">
  `praisonai/src/llm/mod.rs` at line 0
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust LLM" icon="microchip" href="/docs/rust/llm" />

  <Card title="Rust Providers" icon="server" href="/docs/rust/providers" />

  <Card title="Rust Failover" icon="shield" href="/docs/rust/failover" />
</CardGroup>
