> For the complete documentation index, see [llms.txt](https://orpheus.ajac-zero.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://orpheus.ajac-zero.com/basics/configuring-providers.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
