-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from meddhiaka/langchain-based-module
llm-service-boilerplate-fastapi-docker-compose
- Loading branch information
Showing
11 changed files
with
94 additions
and
1 deletion.
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,3 @@ | ||
__pycache__ | ||
llm | ||
.env |
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 @@ | ||
llm | ||
__pycache__ | ||
.vscode | ||
.env |
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 @@ | ||
FROM python:3.9.19-slim-bullseye | ||
|
||
WORKDIR /app | ||
|
||
COPY requirements.txt . | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
COPY models/ /app/models/ | ||
COPY routes/ /app/routes/ | ||
COPY main.py /app/ | ||
|
||
EXPOSE 80 | ||
|
||
CMD [ "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "1337" ] |
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,14 @@ | ||
version: '3.8' | ||
|
||
services: | ||
service-llm: | ||
image: service-llm | ||
container_name: service-llm | ||
ports: | ||
- "1337:1337" | ||
networks: | ||
- llm-network | ||
|
||
networks: | ||
llm-network: | ||
driver: bridge |
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,7 @@ | ||
from fastapi import FastAPI | ||
from routes import testRoute | ||
|
||
app = FastAPI() | ||
|
||
app.include_router(testRoute.router) | ||
|
Empty file.
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 @@ | ||
from pydantic import BaseModel | ||
|
||
class Test(BaseModel): | ||
name: str | ||
v: int |
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,33 @@ | ||
annotated-types==0.7.0 | ||
anyio==4.4.0 | ||
certifi==2024.7.4 | ||
click==8.1.7 | ||
colorama==0.4.6 | ||
dnspython==2.6.1 | ||
email_validator==2.2.0 | ||
fastapi==0.111.1 | ||
fastapi-cli==0.0.4 | ||
h11==0.14.0 | ||
httpcore==1.0.5 | ||
httptools==0.6.1 | ||
httpx==0.27.0 | ||
idna==3.7 | ||
Jinja2==3.1.4 | ||
markdown-it-py==3.0.0 | ||
MarkupSafe==2.1.5 | ||
mdurl==0.1.2 | ||
pydantic==2.8.2 | ||
pydantic_core==2.20.1 | ||
Pygments==2.18.0 | ||
python-dotenv==1.0.1 | ||
python-multipart==0.0.9 | ||
PyYAML==6.0.1 | ||
rich==13.7.1 | ||
shellingham==1.5.4 | ||
sniffio==1.3.1 | ||
starlette==0.37.2 | ||
typer==0.12.3 | ||
typing_extensions==4.12.2 | ||
uvicorn==0.30.3 | ||
watchfiles==0.22.0 | ||
websockets==12.0 |
Empty file.
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,12 @@ | ||
from fastapi import APIRouter | ||
from models.test import Test | ||
|
||
router = APIRouter() | ||
|
||
@router.get("/", status_code=200) | ||
async def read_test(): | ||
return {"message": "you're in the est root"} | ||
|
||
@router.post("/posttest", status_code=201) | ||
async def post_test(test: Test): | ||
return test |
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