Skip to main content

LiteGPT provides free access to the ChatGPT and image generator

Project description

LiteGPT

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.

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 improve the user experience.

Documentation

For detailed documentation on how to use LiteGPT, please refer to the official documentation: LiteGPT Documentation

Installation

You can install the LiteGPT library from PyPI using pip:

pip install litegpt

Usage

Text Queries

The ask function allows you to send a query to the AI chat and receive a response while maintaining chat history.

from litegpt import LiteGPT

# Initialize LiteGPT and send a query
bot = LiteGPT()
response = bot.ask("Your query here...")
print(response)

Text Queries Async

from litegpt import AsyncLiteGPT
import asyncio

async def main():
	# Initialize LiteGPT and send a query
	bot = AsyncLiteGPT()
	response = await bot.ask("Your query here...")
	print(response)
asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

litegpt-1.3.3.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

litegpt-1.3.3-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file litegpt-1.3.3.tar.gz.

File metadata

  • Download URL: litegpt-1.3.3.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for litegpt-1.3.3.tar.gz
Algorithm Hash digest
SHA256 d5a9ba13928aab888356103982166d503e9d6820d0b929d0453861cce12b227d
MD5 af4e0de9f61531ca04eda94a1bb6835a
BLAKE2b-256 dba05204d93d35179d8821bea4756b8efa6e50ea9010acb6ea667254310d1c4e

See more details on using hashes here.

File details

Details for the file litegpt-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: litegpt-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for litegpt-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 31e702d28cab772b108a02e93ae2d6764f2318a89ebb277c4b0679a3658c7126
MD5 baa70ca4c4b9c1f5bdb7dd30eabfb145
BLAKE2b-256 510f9c40c43295b5a3d8af9b09bfad07ecb09c2fff2703d7eaa69ec15924646e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page