# Configuring Providers

You can customize what providers your requests are routed to with the `preferences` parameter in the `chat` and `completions` builders. This allows you to modify your requests to best suit your use case. For example, you could:

* Set Groq as the only provider to get lightning-fast responses.
* Only allow providers that support tool-calling for Agents.
* Only allow providers that do not collect your data for privacy concerns.
* Allow providers with a specific level of quantization to reduce costs.
* Give priority to providers with lower latency/cost, or higher throughput.

The `preferences` parameter accepts a `ProviderPreferences` object that implements the builder pattern:

```rust
// Create a preferences object with any optional parameters
// We will go in-depth into each one in this section.
let preferences = ProviderPreferences::builder()
    .order(iter)
    .allow_fallbacks(value)
    .require_parameters(value)
    .data_collection(value)
    .only(iter)
    .ignore(iter)
    .quantizations(iter)
    .sort(value)
    .max_price(value)
    .build();

let res = client
    .chat("Who is the greatest general of all time?")
    .model("qwen/qwen3-32b")
    .preferences(preferences) // Pass your preferences to the request
    .send()
    .unwrap();
```

However, a more convenient way to do this would be via the `with_preferences` method in the chat request builder, which accepts a closure that builds the `preferences` object internally.

```rust
let res = client
    .chat("Who is the greatest general of all time?")
    .model("qwen/qwen3-32b")
    .with_preferences(|pref| {
        pref
            .order(iter)
            .allow_fallbacks(value)
            .require_parameters(value)
            .data_collection(value)
            .only(iter)
            .ignore(iter)
            .quantizations(iter)
            .sort(value)
            .max_price(value)
    })
    .send()
    .unwrap();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://orpheus.ajac-zero.com/basics/configuring-providers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
