Aodhan Collins 912b205699 Initial commit.
Basic docker deployment with Local LLM integration and simple game state.
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00
2025-08-17 19:31:33 +01:00

Text-Based LLM Interaction System

A Python-based system for interacting with an LLM running on LM Studio through a text-based interface.

Setup Guide

For detailed instructions on setting up pyenv and virtual environments, see setup_guide.md.

Project Structure

text_adventure/
├── main.py              # Entry point
├── config.py             # Configuration settings
├── llm_client.py         # LLM communication
├── interface.py          # Text input/output
├── conversation.py       # Conversation history management
├── test_interface.py     # Test script for interface
└── README.md             # This file

Setup

Option 1: Traditional Setup

  1. Ensure you have Python 3.6+ installed
  2. Install required dependencies:
    pip install -r requirements.txt
    
  3. Make sure LM Studio is running on 10.0.0.200:1234
  1. Install Docker and Docker Compose
  2. Build and run the application:
    docker-compose up --build
    
  3. Make sure LM Studio is running on 10.0.0.200:1234 and accessible from the Docker container

Option 3: Portainer Deployment

  1. Ensure you have a Portainer instance running at 10.0.0.199:9000
  2. Configure your .env file with Portainer credentials (see .env.example)
  3. Run the deployment script:
    python deploy_to_portainer.py
    
  4. Or set environment variables and run:
    export PORTAINER_URL=http://10.0.0.199:9000
    export PORTAINER_USERNAME=admin
    export PORTAINER_PASSWORD=yourpassword
    python deploy_to_portainer.py
    

Usage

To run the main application:

python main.py

Testing

To test the complete system:

python test_system.py

To test just the interface:

python test_interface.py

To test connection to LM Studio:

python test_llm_connection.py

To test message exchange with LLM:

python test_llm_exchange.py

Configuration

The system is configured to connect to LM Studio at http://10.0.0.200:1234. You can modify the config.py file to change this setting.

Components

Main Application (main.py)

The entry point that ties all components together.

Configuration (config.py)

Contains settings for connecting to LM Studio.

LLM Client (llm_client.py)

Handles communication with the LM Studio API.

Interface (interface.py)

Manages text input and output with the user.

Conversation Manager (conversation.py)

Keeps track of the conversation history between user and LLM.

Testing

Run the test_interface.py script to verify the text input/output functionality works correctly.

Description
No description provided
Readme 53 KiB
Languages
Python 84.8%
CSS 6.4%
JavaScript 5.4%
HTML 2.1%
Dockerfile 1.3%