llmine_core
llmine_core copied to clipboard
Add support to configure LLMs in the DB itself, via Admin Panel
Structure and Data Model Changes
- Create a new App called
llm_settings, add it toINSTALLED_APPSbeforecoreand afterdatasources - Within that create a model
LLMConfigwith fieldsllm_name,llm_type(Choices being only OpenAI for now),description - Modify the llm_name field in the
ExtracterChainmodel tollm_configbeing a Foreign Key toLLMConfigmodel - Drop the existing llm_name field
Business Logic Changes
- Modify
get_llm_servicefunction incore/utils/llm_service/__init__.py(It should now take LLMConfig object and return the service class based on the type configured. - Make changes in
core/tasks.pyto match with modifiedget_llm_servicefunction signature.
Fixtures
- Add Fixtures (https://docs.djangoproject.com/en/4.2/topics/db/fixtures/) for sample entry of OpenAI common models for ease of users.
- Maybe need to add changes in docker entrypoints after migrate command.
Admin Panel Changes
- Add required ModelAdmin classes in
core/admin.py
Docs changes
- 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"