-
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.
* Add .gitgnore * Start API with poetry script pop * Refacto providers classes and use field validators * Define enum for languages * Rename project pop * Create script to build docker image * Create script to push docker image * Define tasks build and push with poethepoet * Simplify env variables and rename pop volume to config * Refacto Dockerfile * Pull small model if NO models * Ensure used config is the same as the file * Define custom logger * Move main callable to __init__ module * Move template prompt and default role in globals.py * Generate an uuid in the processor not the api * Sort import with isort * Add comments * Fix typo in Dockerfile * Improve error handling in settings * Remove unused variable Co-authored-by: Denis Roussel <[email protected]> * Remove unused variable f Co-authored-by: Denis Roussel <[email protected]> * Add license header * Refacto way to loop over providers * Tag image with latest and use it as default * Use pathlib to create config file if doesn't exist * Update dependency fastapi * Change host ip * Update outdated dependencies --------- Co-authored-by: Denis Roussel <[email protected]>
- Loading branch information
1 parent
63f0bf6
commit acd4811
Showing
24 changed files
with
2,085 additions
and
2,085 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Ignore the POP configuration file | ||
/pop.yaml | ||
|
||
# Ignore python cache files | ||
__pycache__/ |
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,37 @@ | ||
FROM python:3.10-slim | ||
|
||
ENV PYTHONFAULTHANDLER=1 \ | ||
PYTHONUNBUFFERED=1 \ | ||
PYTHONHASHSEED=random \ | ||
PIP_NO_CACHE_DIR=off \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=on \ | ||
PIP_DEFAULT_TIMEOUT=100 \ | ||
POETRY_VERSION=1.8.3 \ | ||
POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_CREATE=0 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
# System deps: | ||
RUN pip install "poetry==$POETRY_VERSION" | ||
|
||
# Set working directory: | ||
WORKDIR /code | ||
|
||
# Copy only requirements to cache them in docker layer | ||
COPY poetry.lock pyproject.toml README.md /code/ | ||
|
||
# Install dependencies: | ||
RUN poetry install --no-root --without dev | ||
|
||
# Copy the source code: | ||
COPY src/pop pop | ||
|
||
# Install project: | ||
RUN poetry install --without dev | ||
|
||
# Exposing port: | ||
EXPOSE 8000 | ||
|
||
# Running command: | ||
CMD ["poetry", "run", "pop"] | ||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "plugin-output-processing" | ||
version = "0.1.2" | ||
name = "pop" | ||
version = "0.2.0" | ||
description = "REST API taking a plugin output as request and providing an explanation of it thanks to LLMs" | ||
authors = ["Grégory Leventoux <[email protected]>", "Denis Roussel <[email protected]>"] | ||
maintainers = ["Denis Roussel <[email protected]>"] | ||
|
@@ -9,14 +9,23 @@ license = "AGPL-3.0" | |
|
||
[tool.poetry.dependencies] | ||
python = "^3.10" | ||
fastapi = "^0.111.0" | ||
litellm = "^1.41.0" | ||
loguru = "^0.7.0" | ||
ollama = "^0.2.0" | ||
fastapi = "^0.115.0" | ||
litellm = "^1.51.0" | ||
ollama = "^0.3.0" | ||
openai = "^1.35.0" | ||
pydantic = "^2.8.0" | ||
pyyaml = "^6.0.0" | ||
uvicorn = "^0.30.0" | ||
uvicorn = "^0.32.0" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
poethepoet = "^0.29.0" | ||
|
||
[tool.poetry.scripts] | ||
pop = "pop:main" | ||
|
||
[tool.poe.tasks] | ||
build = "bash ./scripts/build.sh" | ||
push = {shell = "bash ./scripts/push.sh", deps = ["build"]} | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
|
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,15 @@ | ||
# Name of the project | ||
PROJECT=pop | ||
|
||
# Registery where images are pushed | ||
REGISTRY=centreonlabs | ||
|
||
# Images are tagged with the project version | ||
TAG=$(poetry version -s) | ||
|
||
# Build the image | ||
IMAGE="$REGISTRY/$PROJECT" | ||
echo | ||
echo -e "Building image \e[34m$IMAGE:$TAG (latest) \e[0m ..." | ||
echo | ||
docker build -t $IMAGE -t "$IMAGE:$TAG" . |
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,28 @@ | ||
# Name of the project | ||
PROJECT=pop | ||
|
||
# Registery where images are pushed | ||
REGISTRY=centreonlabs | ||
|
||
# Images are tagged with the project version | ||
TAG=$(poetry version -s) | ||
|
||
# Login to the registry | ||
echo | ||
docker login | ||
|
||
# Set the image name | ||
IMAGE="$REGISTRY/$PROJECT" | ||
|
||
# Push the image | ||
echo | ||
echo -e "Pushing image \e[34m$IMAGE:$TAG (latest) \e[0m ..." | ||
echo | ||
docker push $IMAGE | ||
docker push "$IMAGE:$TAG" | ||
|
||
|
||
|
||
|
||
|
||
|
Empty file.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.