# Replicate

> **Class** in `langchain_community`

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

Replicate models.

To use, you should have the ``replicate`` python package installed,
and the environment variable ``REPLICATE_API_TOKEN`` set with your API token.
You can find your token here: https://replicate.com/account

The model param is required, but any other model parameters can also
be passed in with the format model_kwargs={model_param: value, ...}

## Signature

```python
Replicate()
```

## Description

**Example:**

.. code-block:: python

from langchain_community.llms import Replicate

replicate = Replicate(
    model=(
        "stability-ai/stable-diffusion: "
        "27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478",
    ),
    model_kwargs={"image_dimensions": "512x512"}
)

## Extends

- `LLM`

## Properties

- `model`
- `model_kwargs`
- `replicate_api_token`
- `prompt_key`
- `version_obj`
- `streaming`
- `stop`
- `model_config`
- `lc_secrets`

## Methods

- [`is_lc_serializable()`](https://reference.langchain.com/python/langchain-community/llms/replicate/Replicate/is_lc_serializable)
- [`get_lc_namespace()`](https://reference.langchain.com/python/langchain-community/llms/replicate/Replicate/get_lc_namespace)
- [`build_extra()`](https://reference.langchain.com/python/langchain-community/llms/replicate/Replicate/build_extra)
- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/llms/replicate/Replicate/validate_environment)

---

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