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

# Weights

Any request to Pulze will result in the selection of a particular model, based on the most suitable model
matching your criteria.

This criteria is a combination of several factors (including which models are enabled, or how creative you want the
response to be) but it's also strongly veered by the interaction between
three key forces: `quality`, `cost`, and `latency`, which can be pre-configured in the App's settings.

<Snippet file="weight-types.mdx" />

<Tip>Their absolute values are not important, only their relative proportions.</Tip>

As a quick example, `quality = 0.7` and `cost = 0.3` (same as `quality = 7`, `cost = 3`) will favour quality of the response, but taking into consideration that the model isn't expensive.

<Tip>You can set the weights on a per-app basis in the **Model Settings page**.</Tip>

## Example

<CodeGroup>
  ```python Weights theme={null}
  weights = {
    "cost": 0.2,
    "quality": 0.8,
    "latency": 0
  }
  ```

  ```bash cURL request theme={null}
  curl ...
  -H "Authorization ..." \
  -H "Pulze-Weights: {\"cost\": 0.2, \"quality\": 0.8, \"latency\": 0}
  ```
</CodeGroup>

The above example will modify the weights *for that request only* -- which might result in a different model being chosen.

If you send [`Pulze-Labels`](/features/custom-headers/labels) header, the weights will be stored as part of the [Labels](/features/labeling) in this format:

```json theme={null}
{
  "weights_cost": "0.2",
  "weights_quality": "0.8",
  "weights_latency": "0",
  ...
  "other-pulze-labels": "below",
  "foo": "bar",
  "my_obj": "{\"key\": \"value\"}"
}
```

<Snippet file="auto-store-labels-if-defined.mdx" />

<Snippet file="request-example-weights-labels-policies.mdx" />
