# TextGen

> **Class** in `langchain_community`

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

Text generation models from WebUI.

To use, you should have the text-generation-webui installed, a model loaded,
and --api added as a command-line option.

Suggested installation, use one-click installer for your OS:
https://github.com/oobabooga/text-generation-webui#one-click-installers

Parameters below taken from text-generation-webui api example:
https://github.com/oobabooga/text-generation-webui/blob/main/api-examples/api-example.py

## Signature

```python
TextGen()
```

## Description

**Example:**

.. code-block:: python

from langchain_community.llms import TextGen
llm = TextGen(model_url="http://localhost:8500")

## Extends

- `LLM`

## Properties

- `model_url`
- `preset`
- `max_new_tokens`
- `do_sample`
- `temperature`
- `top_p`
- `typical_p`
- `epsilon_cutoff`
- `eta_cutoff`
- `repetition_penalty`
- `top_k`
- `min_length`
- `no_repeat_ngram_size`
- `num_beams`
- `penalty_alpha`
- `length_penalty`
- `early_stopping`
- `seed`
- `add_bos_token`
- `truncation_length`
- `ban_eos_token`
- `skip_special_tokens`
- `stopping_strings`
- `streaming`

---

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