llmine_core icon indicating copy to clipboard operation
llmine_core copied to clipboard

Add support to configure LLMs in the DB itself, via Admin Panel

Open arpanpreneur opened this issue 2 years ago • 0 comments

Structure and Data Model Changes

  1. Create a new App called llm_settings, add it to INSTALLED_APPS before core and after datasources
  2. Within that create a model LLMConfig with fields llm_name, llm_type (Choices being only OpenAI for now), description
  3. Modify the llm_name field in the ExtracterChain model to llm_config being a Foreign Key to LLMConfig model
  4. Drop the existing llm_name field

Business Logic Changes

  1. Modify get_llm_service function in core/utils/llm_service/__init__.py (It should now take LLMConfig object and return the service class based on the type configured.
  2. Make changes in core/tasks.py to match with modified get_llm_service function signature.

Fixtures

  1. Add Fixtures (https://docs.djangoproject.com/en/4.2/topics/db/fixtures/) for sample entry of OpenAI common models for ease of users.
  2. Maybe need to add changes in docker entrypoints after migrate command.

Admin Panel Changes

  1. Add required ModelAdmin classes in core/admin.py

Docs changes

  1. For now just update the README in the Supported LLMs section. Add another line after the first item, saying "Fine-tuned GPT-3.5 models"

arpanpreneur avatar Sep 09 '23 08:09 arpanpreneur