# Petals

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/llms/petals/Petals)

Petals Bloom models.

To use, you should have the ``petals`` python package installed, and the
environment variable ``HUGGINGFACE_API_KEY`` set with your API key.

Any parameters that are valid to be passed to the call can be passed
in, even if not explicitly saved on this class.

## Signature

```python
Petals()
```

## Description

**Example:**

.. code-block:: python

from langchain_community.llms import petals
petals = Petals()

## Extends

- `LLM`

## Properties

- `client`
- `tokenizer`
- `model_name`
- `temperature`
- `max_new_tokens`
- `top_p`
- `top_k`
- `do_sample`
- `max_length`
- `model_kwargs`
- `huggingface_api_key`
- `model_config`

## Methods

- [`build_extra()`](https://reference.langchain.com/python/langchain-community/llms/petals/Petals/build_extra)
- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/llms/petals/Petals/validate_environment)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/llms/petals.py#L15)