Skip to content

LLM Integration

peter-olai edited this page May 7, 2025 · 3 revisions

LLM Integration

The LLM.py module is responsible for handling all interactions with the configured Large Language Model (LLM).

Functionality

  • Model Abstraction: Provides a consistent interface for communicating with different LLMs (e.g., OpenAI GPT models, local models).
  • Prompt Engineering: May include logic for constructing effective prompts based on user input and context.
  • Response Parsing: Processes the raw output from the LLM into a usable format.
  • Configuration: Loads LLM-specific settings (e.g., API keys, model names) from config.py.

Usage

Other parts of the service, particularly the main request processing Pipeline (detailed in pipeline.py) or API route handlers, will use this module to:

  1. Take user input (and any RAG-retrieved context).
  2. Format it into a prompt.
  3. Send the prompt to the LLM.
  4. Receive and return the LLM's generated response.

(Further details on specific functions, classes, and error handling within LLM.py should be added here.)

Clone this wiki locally