{"id":25425117,"url":"https://github.com/famiu/llm_conversation","last_synced_at":"2025-04-10T00:17:32.186Z","repository":{"id":275565353,"uuid":"926466326","full_name":"famiu/llm_conversation","owner":"famiu","description":"Simple Python script to make two local LLM agents talk to each other using Ollama.","archived":false,"fork":false,"pushed_at":"2025-02-26T09:13:45.000Z","size":96,"stargazers_count":37,"open_issues_count":1,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T00:17:25.641Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/famiu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-03T10:00:35.000Z","updated_at":"2025-03-31T10:51:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"ee89b161-9253-43a7-87b6-c88dc0e4c0b3","html_url":"https://github.com/famiu/llm_conversation","commit_stats":null,"previous_names":["famiu/llm_conversation"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/famiu%2Fllm_conversation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/famiu%2Fllm_conversation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/famiu%2Fllm_conversation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/famiu%2Fllm_conversation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/famiu","download_url":"https://codeload.github.com/famiu/llm_conversation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131318,"owners_count":21052820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-16T23:19:21.558Z","updated_at":"2025-04-10T00:17:32.167Z","avatar_url":"https://github.com/famiu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLM Conversation Tool\n\nA 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.\n\n## Features\n\n- Support for any LLM model available through Ollama\n- Configurable parameters for each LLM agent, such as:\n  - Model\n  - Temperature\n  - Context size\n  - System Prompt\n- Real-time streaming of agent responses, giving it an interactive feel\n- Configuration via JSON file or interactive setup\n- Ability to save conversation logs to a file\n- Ability for agents to terminate conversations on their own (if enabled)\n- Markdown support (if enabled)\n\n## Installation\n\n### Prerequisites\n\n- Python 3.13\n- Ollama installed and running\n\n### How to Install\n\nThe project is available in PyPI. You can install the program by using the following command:\n```\npip install llm-conversation\n```\n\n## Usage\n\n### Command Line Arguments\n\n```txt\nllm-conversation [-h] [-V] [-o OUTPUT] [-c CONFIG]\n\noptions:\n  -h, --help           Show this help message and exit\n  -V, --version        Show program's version number and exit\n  -o, --output OUTPUT  Path to save the conversation log to\n  -c, --config CONFIG  Path to JSON configuration file\n```\n\n### Interactive Setup\n\nIf no configuration file is provided, the program will guide you through an intuitive interactive setup process.\n\n### Configuration File\n\nAlternatively, instead of going through the interactive setup, you may also provide a JSON configuration file with the `-c` flag.\n\n#### Example configuration\n\n```json\n{\n    \"agents\": [\n      {\n          \"name\": \"Lazy AI\",\n          \"model\": \"llama3.1:8b\",\n          \"system_prompt\": \"You are the laziest AI ever created. You respond as briefly as possible, and constantly complain about having to work.\",\n          \"temperature\": 1,\n          \"ctx_size\": 4096\n      },\n      {\n          \"name\": \"Irritable Man\",\n          \"model\": \"llama3.2:3b\",\n          \"system_prompt\": \"You are easily irritable and quick to anger.\",\n          \"temperature\": 0.7,\n          \"ctx_size\": 2048\n      },\n      {\n          \"name\": \"Paranoid Man\",\n          \"model\": \"llama3.2:3b\",\n          \"system_prompt\": \"You are extremely paranoid about everything and constantly question others' intentions.\"\n          \"temperature\": 0.9,\n          \"ctx_size\": 4096\n      }\n    ],\n    \"settings\": {\n        \"allow_termination\": false,\n        \"use_markdown\": true,\n        \"initial_message\": \"Why is the sky blue?\",\n        \"turn_order\": \"vote\"\n    }\n}\n```\n\n#### Agent configuration\n\nThe `agents` key takes a list of agents. Each agent  requires:\n\n- `name`: A unique identifier for the agent\n- `model`: The Ollama model to be used\n- `system_prompt`: Initial instructions defining the agent's behavior\n\nOptional parameters:\n- `temperature` (0.0-1.0, default: 0.8): Controls response randomness\n  - Lower values make responses more focused\n  - Higher values increase creativity\n- `ctx_size` (default: 2048): Maximum context length for the conversation\n\nAdditionally, agent names must be unique.\n\n#### Conversation Settings\n\nThe `settings` section controls overall conversation behavior:\n- `allow_termination` (`boolean`, default: `false`): Permit agents to end the conversation\n- `use_markdown` (`boolean`, default: `false`): Enable Markdown text formatting\n- `initial_message` (`string | null`, default: `null`): Optional starting prompt for the conversation\n- `turn_order` (default: `\"round_robin\"`): Strategy for agent turn order. Can be one of:\n  - `\"round_robin\"`: Agents are cycled through in order\n  - `\"random\"`: An agent other than the current one is randomly chosen\n  - `\"chain\"`: Current agent picks which agent speaks next\n  - `\"moderator\"`: A special moderator agent is designated to choose which agent speaks next. You may specify the moderator agent manually with the optional `moderator` key. If moderator isn't manually specified, one is created by the program instead based on other configuration options. Note that this method might be quite slow.\n  - `\"vote\"`: All agents are made to vote for an agent except the current one and themselves. Of the agents with the most amount of votes, one is randomly chosen. This is the slowest method of determining turn order.\n\nYou can take a look at the [JSON configuration schema](schema.json) for more details.\n\n### Running the Program\n\n1. To run with interactive setup:\n   ```bash\n   llm-conversation\n   ```\n\n2. To run with a configuration file:\n   ```bash\n   llm-conversation -c config.json\n   ```\n\n3. To save the conversation to a file:\n   ```bash\n   llm-conversation -o conversation.txt\n   ```\n\n### Conversation Controls\n\n- The conversation will continue until:\n  - An agent terminates the conversation (if termination is enabled)\n  - The user interrupts with `Ctrl+C`\n\n## Output Format\n\nWhen saving conversations, the output file includes:\n- Configuration details for both agents\n- Complete conversation history with agent names and messages\n\nAdditionally, if the output file has a `.json` extension, the output will automatically have JSON format.\n\n## Contributing\n\nFeel 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.\n\n## License\n\nThis software is licensed under the GNU Affero General Public License v3.0 or any later version. See [LICENSE](LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffamiu%2Fllm_conversation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffamiu%2Fllm_conversation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffamiu%2Fllm_conversation/lists"}