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

# Choose and Configure Language Models

> Choose and configure language models from Dasha Reflex-1, OpenAI, Groq, xAI Grok, DeepSeek, or custom providers for your AI voice agents.

Your agent's language model determines how it understands context, generates responses, and makes decisions. Dasha BlackBox supports multiple LLM providers, each with different strengths for voice conversations.

**What you'll learn:** Choosing a provider, configuring temperature, using custom endpoints, and optimizing for voice.

<Note>
  LLM latency typically accounts for 40–60% of total response time. We've measured this across millions of production calls — choosing the right provider and settings directly impacts conversation quality and caller satisfaction.
</Note>

***

## Recommended providers

| Provider     | Best for                                                   |
| ------------ | ---------------------------------------------------------- |
| **Reflex-1** | Low-latency voice conversations, native Dasha optimization |
| **OpenAI**   | Production reliability, industry-leading quality           |

**Reflex-1** is Dasha's in-house model, built specifically for real-time voice.

OpenAI remains our primary third-party provider, fully tested and optimized for Dasha BlackBox voice conversations.

<Tip>
  **Priority Tier**: Enable priority tier for OpenAI to reduce latency at the cost of higher LLM pricing. This is recommended for latency-sensitive production deployments where response speed directly impacts conversation quality.
</Tip>

## Alternative providers

The following providers are supported through OpenAI-compatible APIs. While functional, they have not been extensively tested on our platform. We recommend thorough testing before production use.

| Provider       | Notes                                   |
| -------------- | --------------------------------------- |
| **Groq**       | High throughput with open-source models |
| **Grok (xAI)** | Advanced reasoning capabilities         |
| **DeepSeek**   | Cost efficiency with high quality       |

<Warning>
  Alternative providers may exhibit different latency characteristics, response formats, or edge-case behaviors compared to OpenAI. Test extensively with your specific use cases before deploying to production.
</Warning>

***

## Configuration

<Tabs>
  <Tab title="Dashboard">
    1. Go to the **LLM Config** tab
    2. Select your vendor from the dropdown
    3. Choose a model
    4. Configure temperature
    5. Save your agent
  </Tab>

  <Tab title="API">
    <Accordion title="API example: LLM configuration">
      ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"}}
      llmConfig: {
        vendor: "openai",
        model: "gpt-4.1-mini",
        prompt: "You are a helpful assistant...",
        options: {
          temperature: 0.7,
          topP: 0.9
        }
      }
      ```
    </Accordion>
  </Tab>
</Tabs>

***

## LLM parameters

All LLM vendors support standard configuration parameters that control response behavior.

### Temperature

Controls randomness and creativity in responses.

| Range       | Behavior                            | Use when                                        |
| ----------- | ----------------------------------- | ----------------------------------------------- |
| **0.0–0.5** | Focused, deterministic, consistent  | FAQs, factual information, structured workflows |
| **0.6–0.9** | Balanced creativity and consistency | General conversation, customer support          |
| **1.0–2.0** | Creative, varied, unpredictable     | Rarely used for voice agents                    |

**For production voice agents, use temperature between 0.6–0.8.** In our testing across thousands of calls, this range produces consistent yet natural-sounding responses. Lower values feel robotic; higher values risk hallucinations and off-topic tangents.

### Top P (nucleus sampling)

Alternative to temperature for controlling randomness via probability mass.

| Value   | Effect                                                      |
| ------- | ----------------------------------------------------------- |
| **0.9** | Only considers tokens in top 90% probability — more focused |
| **1.0** | Considers all tokens — standard behavior                    |

**OpenAI recommends using either temperature or topP, not both.** If you set both, temperature takes precedence.

***

## Custom compatible provider

Use any OpenAI-compatible API endpoint, including self-hosted models or alternative providers.

### When to use custom providers

* Self-hosted models for data privacy
* Alternative providers with OpenAI-compatible APIs
* Custom fine-tuned models
* On-premise deployments

### Configuration

<Tabs>
  <Tab title="Dashboard">
    1. Select **Custom Compatible** as your vendor
    2. Enter the **Endpoint URL** (e.g., `https://api.yourprovider.com/v1`)
    3. Enter your **API Key** (minimum 10 characters)
    4. Enter the **Model ID** as recognized by your provider
    5. Configure standard LLM parameters
    6. Save your agent
  </Tab>

  <Tab title="API">
    <Accordion title="API example: Custom provider configuration">
      ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"}}
      llmConfig: {
        vendor: "customCompatible",
        model: "your-model-name",
        endpoint: "https://api.yourprovider.com/v1",
        apiKey: "your-provider-api-key",
        prompt: "You are a custom AI assistant.",
        options: {
          temperature: 0.7
        }
      }
      // Latency: Depends on your provider infrastructure
      ```
    </Accordion>
  </Tab>
</Tabs>

<Warning>
  Custom providers must implement the OpenAI Chat Completions API format. Incompatible APIs cause agent failures. Test thoroughly before production use.
</Warning>

***

## Testing and optimization

### A/B testing LLMs

Compare different vendors for your specific use case:

1. Create identical agents with different LLM configs
2. Run parallel test calls with the same scenarios
3. Measure response quality, speed, length, and success rate
4. Compare costs over 100–1000 calls

### Parameter tuning

**Temperature tuning:**

1. Start at 0.7 (balanced)
2. Test with real conversation scenarios
3. Adjust based on observations:
   * Too robotic/repetitive → Increase to 0.8–0.9
   * Too creative/inconsistent → Decrease to 0.5–0.6
   * Hallucinating information → Decrease to 0.3–0.5

***

## Next steps

<CardGroup cols={2}>
  <Card title="Voice & Speech" icon="microphone" href="/docs/create/voice-and-speech">
    Configure text-to-speech providers
  </Card>

  <Card title="Tools & Functions" icon="wrench" href="/docs/create/tools-and-functions">
    Enable agents to call external APIs
  </Card>

  <Card title="Test Your Agent" icon="flask" href="/docs/test/dashboard-testing">
    Validate agent responses
  </Card>

  <Card title="Production Checklist" icon="rocket" href="/docs/deploy/production-checklist">
    Pre-deployment verification
  </Card>
</CardGroup>
