ParisNeo / lollms_client

A client to lollms server written in python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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!

About

A client to lollms server written in python

License:Apache License 2.0


Languages

Language:Python 100.0%