Skip to main content

A client library for LoLLMs generate endpoint

Project description

lollms_client

Python Version PyPI Downloads Apache License

Welcome to the lollms_client repository! This library is built by ParisNeo and provides a convenient way to interact with the lollms (Lord Of Large Language Models) API. It is available on PyPI and distributed under the Apache 2.0 License.

Installation

To install the library from PyPI using pip, run:

pip install lollms-client

Usage

To use the lollms_client, first import the necessary classes:

from lollms_client import LollmsClient

# Initialize the LollmsClient instance
lc = LollmsClient("http://localhost:9600")

Text Generation

Use generate_text() for generating text from the lollms API.

response = lc.generate_text(prompt="Once upon a time", stream=False, temperature=0.5)
print(response)

Completion

Use generate_completion() for getting a completion of the prompt from the lollms API.

response = lc.generate_completion(prompt="What is the capital of France", stream=False, temperature=0.5)
print(response)

List Mounted Personalities

List mounted personalities of the lollms API with the listMountedPersonalities() method.

response = lc.listMountedPersonalities()
print(response)

List Models

List available models of the lollms API with the listModels() method.

response = lc.listModels()
print(response)

Complete Example

from lollms_client import LollmsClient

# Initialize the LollmsClient instance
lc = LollmsClient("http://localhost:9600")

# Generate Text
response = lc.generate_text(prompt="Once upon a time", stream=False, temperature=0.5)
print(response)

# Generate Completion
response = lc.generate_completion(prompt="What is the capital of France", stream=False, temperature=0.5)
print(response)

# List Mounted Personalities
response = lc.listMountedPersonalities()
print(response)

# List Models
response = lc.listModels()
print(response)

Feel free to contribute to the project by submitting issues or pull requests. Follow ParisNeo on GitHub, Twitter, Discord, Sub-Reddit, and Instagram for updates and news.

Happy coding!

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

lollms_client-0.2.5.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

lollms_client-0.2.5-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file lollms_client-0.2.5.tar.gz.

File metadata

  • Download URL: lollms_client-0.2.5.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for lollms_client-0.2.5.tar.gz
Algorithm Hash digest
SHA256 7a0a9417618ede68be02160dc8f8c7ccca035d05c8b744ab7913b1331d00f1ba
MD5 307a85fca523366a7087129e74a5ef60
BLAKE2b-256 c5692fa532ecfd041fb123420be1293c53d2d5a96f5cbf98fe86e511e780047a

See more details on using hashes here.

File details

Details for the file lollms_client-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: lollms_client-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for lollms_client-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e089594c07f4fde7cb53c22ee1d2ef4fea5965a1979e4faafb572bdd4695efa5
MD5 85379edb60140129f1eba7310e4d4422
BLAKE2b-256 310faed3d5a7317eaf87f9015da2627e52b1754c09e3fa086de65282f740ad6b

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