A client library for LoLLMs generate endpoint
Project description
lollms_client
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
Built Distribution
File details
Details for the file lollms_client-0.7.0.tar.gz
.
File metadata
- Download URL: lollms_client-0.7.0.tar.gz
- Upload date:
- Size: 48.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08e974292028f68ef598ec807e23ece304583995be26138bc9edf4a0ce10cd03 |
|
MD5 | ac1c73c80c8ef228226fe32fba8e0019 |
|
BLAKE2b-256 | c5070325cd38bc7cb7703963fea1d9734b845094eafbd9466e49f668a9af0852 |
File details
Details for the file lollms_client-0.7.0-py3-none-any.whl
.
File metadata
- Download URL: lollms_client-0.7.0-py3-none-any.whl
- Upload date:
- Size: 53.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffc3846eee651677cd4018f396ed7d665a3bcd72cdb811a7961bd0bcb74fdc4c |
|
MD5 | 0faa0a49738f254d8363bbcf2788a00c |
|
BLAKE2b-256 | d64bddbaa5e819fb6a11b757e6ab28cb8fe2d07ca75c5b78c09a358cb2cc6df3 |