A tool for LLM agent conversations
Project description
LLM Conversation Tool
A Python application that enables conversations between LLM agents using the Ollama API. The agents can engage in back-and-forth dialogue with configurable parameters and models.
Features
- Support for any LLM model available through Ollama
- Configurable parameters for each LLM agent, such as:
- Model
- Temperature
- Context size
- System Prompt
- Real-time streaming of agent responses, giving it an interactive feel
- Configuration via JSON file or interactive setup
- Ability to save conversation logs to a file
- Ability for agents to terminate conversations on their own (if enabled)
- Markdown support (if enabled)
Installation
Prerequisites
- Python 3.13
- Ollama installed and running
How to Install
The project is available in PyPI. You can install the program by using the following command:
pip install llm-conversation
Usage
Command Line Arguments
llm-conversation [-h] [-V] [-o OUTPUT] [-c CONFIG]
options:
-h, --help Show this help message and exit
-V, --version Show program's version number and exit
-o, --output OUTPUT Path to save the conversation log to
-c, --config CONFIG Path to JSON configuration file
Interactive Setup
If no configuration file is provided, the program will guide you through an intuitive interactive setup process.
Configuration File
Alternatively, instead of going through the interactive setup, you may also provide a JSON configuration file with the -c flag.
Example configuration
{
"agents": [
{
"name": "Lazy AI",
"model": "llama3.1:8b",
"system_prompt": "You are the laziest AI ever created. You respond as briefly as possible, and constantly complain about having to work.",
"temperature": 1,
"ctx_size": 4096
},
{
"name": "Irritable Man",
"model": "llama3.2:3b",
"system_prompt": "You are easily irritable and quick to anger.",
"temperature": 0.7,
"ctx_size": 2048
},
{
"name": "Paranoid Man",
"model": "llama3.2:3b",
"system_prompt": "You are extremely paranoid about everything and constantly question others' intentions."
"temperature": 0.9,
"ctx_size": 4096
}
],
"settings": {
"allow_termination": false,
"use_markdown": true,
"initial_message": "*yawn* What do you want?"
}
}
Agent configuration
The agents key takes a list of agents. Each agent requires:
name: A unique identifier for the agentmodel: The Ollama model to be usedsystem_prompt: Initial instructions defining the agent's behavior
Optional parameters:
temperature(0.0-1.0, default: 0.8): Controls response randomness- Lower values make responses more focused
- Higher values increase creativity
ctx_size(default: 2048): Maximum context length for the conversation
Conversation Settings
The settings section controls overall conversation behavior:
allow_termination(default:false): Permit agents to end the conversationuse_markdown(default:false): Enable Markdown text formattinginitial_message(default:null): Optional starting prompt for the conversation
You can take a look at the JSON configuration schema for more details.
Running the Program
-
To run with interactive setup:
llm-conversation
-
To run with a configuration file:
llm-conversation -c config.json
-
To save the conversation to a file:
llm-conversation -o conversation.txt
Conversation Controls
- The conversation will continue until:
- An agent terminates the conversation (if termination is enabled)
- The user interrupts with
Ctrl+C
Output Format
When saving conversations, the output file includes:
- Configuration details for both agents
- Complete conversation history with agent names and messages
Additionally, if the output file has a .json extension, the output will automatically have JSON format.
Contributing
Feel free to submit issues and pull requests for bug fixes or new features. Do keep in mind that this is a hobby project, so please have some patience.
License
This software is licensed under the GNU Affero General Public License v3.0 or any later version. See LICENSE for more details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_conversation-0.1.2.post1.tar.gz.
File metadata
- Download URL: llm_conversation-0.1.2.post1.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c7c0a42dd354c9d78004d747d890e362958ee75430743ad19ee948eff6540da
|
|
| MD5 |
384fc56ee144f310a04f2ca6b7b99d49
|
|
| BLAKE2b-256 |
6023ef8b901557a09a3811b4c5c4b1cdb0c4f744fd4485babb16e8bea6c00472
|
Provenance
The following attestation bundles were made for llm_conversation-0.1.2.post1.tar.gz:
Publisher:
pypi-publish.yaml on famiu/llm_conversation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_conversation-0.1.2.post1.tar.gz -
Subject digest:
7c7c0a42dd354c9d78004d747d890e362958ee75430743ad19ee948eff6540da - Sigstore transparency entry: 169812699
- Sigstore integration time:
-
Permalink:
famiu/llm_conversation@eea5253f00d73c4c7efc166cf80b5ec0018e5307 -
Branch / Tag:
refs/tags/v0.1.2.post1 - Owner: https://github.com/famiu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yaml@eea5253f00d73c4c7efc166cf80b5ec0018e5307 -
Trigger Event:
push
-
Statement type:
File details
Details for the file llm_conversation-0.1.2.post1-py3-none-any.whl.
File metadata
- Download URL: llm_conversation-0.1.2.post1-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
822ce9ad3d4742f25e0767dc0b324db4a24db1f33782472ccd7fbd71f1baad62
|
|
| MD5 |
93ab0b8af3363bb95d67c11cb36453e9
|
|
| BLAKE2b-256 |
f485f7efceb43fe9e1096b92997d25d73950dfc778db60e16239d7ebf7563604
|
Provenance
The following attestation bundles were made for llm_conversation-0.1.2.post1-py3-none-any.whl:
Publisher:
pypi-publish.yaml on famiu/llm_conversation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_conversation-0.1.2.post1-py3-none-any.whl -
Subject digest:
822ce9ad3d4742f25e0767dc0b324db4a24db1f33782472ccd7fbd71f1baad62 - Sigstore transparency entry: 169812700
- Sigstore integration time:
-
Permalink:
famiu/llm_conversation@eea5253f00d73c4c7efc166cf80b5ec0018e5307 -
Branch / Tag:
refs/tags/v0.1.2.post1 - Owner: https://github.com/famiu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yaml@eea5253f00d73c4c7efc166cf80b5ec0018e5307 -
Trigger Event:
push
-
Statement type: