-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shared llm package refactoring (#336)
Co-authored-by: = Enea_Gore <[email protected]>
- Loading branch information
Showing
45 changed files
with
3,669 additions
and
1,869 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Comment out the variables that you define somewhere else | ||
# Environment variables are overwritten by .env file | ||
|
||
PRODUCTION=0 | ||
SECRET=12345abcdef | ||
DATABASE_URL=sqlite:///../data/data.sqlite | ||
|
||
|
||
################################################################ | ||
# LLM Credentials # | ||
################################################################ | ||
|
||
# Default model to use | ||
# See below for options, available models are also logged on startup | ||
LLM_DEFAULT_MODEL="azure_openai_gpt-35-turbo" | ||
|
||
# Enable LLM-as-a-judge approach 0 = disabled, 1 = enabled | ||
LLM_ENABLE_LLM_AS_A_JUDGE=1 | ||
# Evaluation model to use for the LLM-as-a-judge approach [Only important if you want to use it in the /evaluate endpoint] | ||
# See below for options, available models are also logged on startup | ||
LLM_EVALUATION_MODEL="azure_openai_gpt-4o" | ||
|
||
# Standard OpenAI (Non-Azure) [leave blank if not used] | ||
# Model names prefixed with `openai_` followed by the model name, e.g. `openai_text-davinci-003` | ||
# A list of models can be found in `module_text_llm/helpers/models/openai.py` (openai_models) | ||
OPENAI_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | ||
|
||
# Azure OpenAI [leave blank if not used] | ||
# Model names prefixed with `azure_openai_` followed by the deployment id, e.g. `azure_openai_gpt-35` | ||
AZURE_OPENAI_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | ||
AZURE_OPENAI_ENDPOINT="https://ase-eu01.openai.azure.com/" # change base if needed | ||
OPENAI_API_VERSION="2024-06-01" # change base if needed | ||
|
||
# LangSmith (can be used for tracing LLMs) [leave blank if not used] | ||
# See https://docs.smith.langchain.com | ||
# LANGCHAIN_TRACING_V2=true | ||
# LANGCHAIN_ENDPOINT="https://api.smith.langchain.com" | ||
# LANGCHAIN_API_KEY="XXX" | ||
# LANGCHAIN_PROJECT="XXX" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# This is the Dockerfile for the shared llm package. | ||
# Its output is used as a dependency in the module_* Dockerfiles. | ||
|
||
FROM python:3.11 as llm_core | ||
|
||
WORKDIR /code | ||
|
||
# Poetry | ||
RUN pip install --no-cache-dir poetry==1.5.0 | ||
|
||
# Dependencies | ||
COPY pyproject.toml poetry.lock ./ | ||
COPY --from=athena /code /athena | ||
|
||
RUN poetry config virtualenvs.create false \ | ||
&& poetry install --no-interaction --no-ansi | ||
|
||
# Project files | ||
COPY . ./ | ||
|
||
# Build the package | ||
RUN poetry build -f wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import dotenv | ||
|
||
# Load environment variables from .env file (for local development) | ||
dotenv.load_dotenv(override=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.