# GradientLLM

> **Class** in `langchain_community`

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

Gradient.ai LLM Endpoints.

GradientLLM is a class to interact with LLMs on gradient.ai

To use, set the environment variable ``GRADIENT_ACCESS_TOKEN`` with your
API token and ``GRADIENT_WORKSPACE_ID`` for your gradient workspace,
or alternatively provide them as keywords to the constructor of this class.

## Signature

```python
GradientLLM()
```

## Description

**Example:**

.. code-block:: python

from langchain_community.llms import GradientLLM
GradientLLM(
    model="99148c6d-c2a0-4fbe-a4a7-e7c05bdb8a09_base_ml_model",
    model_kwargs={
        "max_generated_token_count": 128,
        "temperature": 0.75,
        "top_p": 0.95,
        "top_k": 20,
        "stop": [],
    },
    gradient_workspace_id="12345614fc0_workspace",
    gradient_access_token="gradientai-access_token",
)

## Extends

- `BaseLLM`

## Properties

- `model_id`
- `gradient_workspace_id`
- `gradient_access_token`
- `model_kwargs`
- `gradient_api_url`
- `aiosession`
- `model_config`

## Methods

- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/llms/gradient_ai/GradientLLM/validate_environment)
- [`post_init()`](https://reference.langchain.com/python/langchain-community/llms/gradient_ai/GradientLLM/post_init)
- [`train_unsupervised()`](https://reference.langchain.com/python/langchain-community/llms/gradient_ai/GradientLLM/train_unsupervised)
- [`atrain_unsupervised()`](https://reference.langchain.com/python/langchain-community/llms/gradient_ai/GradientLLM/atrain_unsupervised)

---

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