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

# PydanticAI

export const GCell = ({children, className}) => <div className={`grid-table-cell ${className || ""}`} role="cell">
    {children}
  </div>;

export const GTH = ({children, className}) => <div className={`grid-table-th ${className || ""}`} role="columnheader">
    {children}
  </div>;

export const GRow = ({children}) => <div className="grid-table-row" role="row">{children}</div>;

export const GBody = ({children}) => <div className="grid-table-body" role="rowgroup">{children}</div>;

export const GHead = ({children}) => <div className="grid-table-head" role="rowgroup">{children}</div>;

export const GTable = ({children, className, cols}) => <div className={`grid-table not-prose overflow-hidden rounded-2xl ${className || ""}`} style={{
  "--grid-table-cols": cols
}} role="table">
    {children}
  </div>;

The PydanticAI integration provides Chat and Embedding classes that automatically manage downloading models and starting servers.

## Chat model usage

Here is a minimal setup example for using PydanticAI chat models with Anaconda AI:

```python theme={null}
from pydantic import BaseModel
from anaconda_ai.integrations.pydantic_ai import AnacondaChatModel

class UserInfo(BaseModel):
    name: str
    age: int

model = AnacondaChatModel(
    "OpenHermes-2.5-Mistral-7B_Q4_K_M.gguf",
    extra_options={
        'ctx_size': 4096,
        'n_gpu_layers': 20,
        'temp': 0.7
    }
)
```

To use an already running server, pass `server/<server-name>` as the model name:

```python theme={null}
model = AnacondaChatModel("server/my-server")
```

## Embedding model usage

```python theme={null}
from anaconda_ai.integrations.pydantic_ai import AnacondaEmbeddingModel

embed = AnacondaEmbeddingModel(
    "sentence-transformers/bge-small-en-v1.5/q4_k_m"
)

result = await embed.embed("cat", input_type="document")
```

To use an already running server, pass `server/<server-name>` as the model name:

```python theme={null}
embed = AnacondaEmbeddingModel("server/my-server")
```

For more information on using PydanticAI, see the [official documentation](https://ai.pydantic.dev/).
