> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Shubhamsaboo/awesome-llm-apps/llms.txt
> Use this file to discover all available pages before exploring further.

# Model Configuration

> Configure and use different LLM models across providers

# Model Configuration

Configure LLM models from different providers for your applications.

## Model Selection

### OpenAI Models

```python theme={null}
from openai import OpenAI

client = OpenAI()

# GPT-4o (recommended)
response = client.chat.completions.create(
    model="gpt-4o",
    messages=messages,
    temperature=0.7
)

# GPT-4o-mini (faster, cheaper)
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=messages
)
```

### Anthropic Models

```python theme={null}
from anthropic import Anthropic

client = Anthropic()

# Claude 3.5 Sonnet
response = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=4096,
    messages=messages
)
```

### Google Models

```python theme={null}
import google.generativeai as genai

model = genai.GenerativeModel('gemini-1.5-pro')
response = model.generate_content(prompt)
```

## Common Parameters

<ParamField path="temperature" type="number" default={0.7}>
  Controls randomness (0.0 = deterministic, 1.0 = creative)
</ParamField>

<ParamField path="max_tokens" type="integer">
  Maximum tokens in response
</ParamField>

<ParamField path="top_p" type="number" default={1.0}>
  Nucleus sampling threshold
</ParamField>

## Framework Integration

### Agno

```python theme={null}
from agno import Agent, OpenAI, Anthropic, Gemini

# OpenAI
agent = Agent(model=OpenAI(id="gpt-4o"))

# Anthropic
agent = Agent(model=Anthropic(id="claude-3-5-sonnet-20241022"))

# Gemini
agent = Agent(model=Gemini(id="gemini-1.5-pro"))
```

### LangChain

```python theme={null}
from langchain_openai import ChatOpenAI
from langchain_anthropic import ChatAnthropic
from langchain_google_genai import ChatGoogleGenerativeAI

llm = ChatOpenAI(model="gpt-4o")
llm = ChatAnthropic(model="claude-3-5-sonnet-20241022")
llm = ChatGoogleGenerativeAI(model="gemini-1.5-pro")
```

## Local Models (Ollama)

```python theme={null}
from agno import Agent, Ollama

# Run Llama 3.2 locally
agent = Agent(model=Ollama(id="llama3.2"))
```

<Note>
  Install Ollama from [ollama.ai](https://ollama.ai) for local model support.
</Note>

## Related Resources

<CardGroup cols={2}>
  <Card title="API Keys" icon="key" href="/api/api-keys">
    Set up provider API keys
  </Card>

  <Card title="Local RAG" icon="house" href="/rag/local-rag">
    Use local models with Ollama
  </Card>
</CardGroup>
