# Yuan2

> **Class** in `langchain_community`

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

Yuan2.0 language models.

## Signature

```python
Yuan2(
    self,
    **kwargs: Any = {},
)
```

## Description

**Example:**

.. code-block:: python

yuan_llm = Yuan2(
    infer_api="http://127.0.0.1:8000/yuan",
    max_tokens=1024,
    temp=1.0,
    top_p=0.9,
    top_k=40,
)
print(yuan_llm)
print(yuan_llm.invoke("你是谁？"))

## Extends

- `LLM`

## Constructors

```python
__init__(
    self,
    **kwargs: Any = {},
) -> None
```


## Properties

- `infer_api`
- `max_tokens`
- `temp`
- `top_p`
- `top_k`
- `do_sample`
- `echo`
- `stop`
- `repeat_last_n`
- `repeat_penalty`
- `streaming`
- `history`
- `use_history`

---

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