# Welcome

LiteGPT is a simple Python library designed for interacting with APIs, enabling text query submission and image generation in a chat format. It supports saving chat history and configuring an HTTP client with the option to use HTTP/2 for faster data transfer. The library is built with a simplified interface, making it easy to integrate with various chatbots or user applications working with generative AI.

**Key Features:**

* **Text Queries:** The `ask` method sends user queries to the API and processes the response. It includes support for message history, allowing continuous dialogue.
* **Image Generation:** The `image` method sends a text description to generate an image and returns the result in JSON format.
* **Message History Management:** The library supports working with message history through the external `History` class, making it easy to track the conversation and enhance the user experience.

**Installation:**

```bash
pip install litegpt
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://red-3.gitbook.io/litegpt/welcome.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
