# Anyscale

> **Class** in `langchain_community`

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

Anyscale large language models.

To use, you should have the environment variable ``ANYSCALE_API_KEY``set with your
Anyscale Endpoint, or pass it as a named parameter to the constructor.
To use with Anyscale Private Endpoint, please also set ``ANYSCALE_BASE_URL``.

## Signature

```python
Anyscale()
```

## Description

**Example:**

.. code-block:: python
from langchain_classic.llms import Anyscale
anyscalellm = Anyscale(anyscale_api_key="ANYSCALE_API_KEY")
# To leverage Ray for parallel processing
@ray.remote(num_cpus=1)
def send_query(llm, text):
    resp = llm.invoke(text)
    return resp
futures = [send_query.remote(anyscalellm, text) for text in texts]
results = ray.get(futures)

## Extends

- `BaseOpenAI`

## Properties

- `anyscale_api_base`
- `anyscale_api_key`
- `model_name`
- `prefix_messages`

## Methods

- [`is_lc_serializable()`](https://reference.langchain.com/python/langchain-community/llms/anyscale/Anyscale/is_lc_serializable)
- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/llms/anyscale/Anyscale/validate_environment)

---

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