Skip to content

Commit 2d4d68f

Browse files
committed
initial commit
1 parent a225f8c commit 2d4d68f

19 files changed

+1818
-4
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
description: Run pre-commit hooks on every push and pull request to the main branch.
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
pre-commit-hooks:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python 3.12
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version-file: "pyproject.toml"
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v6
24+
with:
25+
version: 0.7.1
26+
27+
- name: Install dependencies
28+
run: |
29+
uv sync --locked --all-extras --dev
30+
31+
- name: Run pre-commit hooks
32+
run: |
33+
uv run pre-commit run --all-files --show-diff-on-failure

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ cython_debug/
182182
.abstra/
183183

184184
# Visual Studio Code
185-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
185+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186186
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
187+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188188
# you could uncomment the following to ignore the entire vscode folder
189189
# .vscode/
190190

@@ -205,3 +205,6 @@ cython_debug/
205205
marimo/_static/
206206
marimo/_lsp/
207207
__marimo__/
208+
209+
.DS_Store
210+
temp_steps.md

.pre-commit-config.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
10+
- repo: https://github.com/astral-sh/ruff-pre-commit
11+
rev: v0.12.11
12+
hooks:
13+
- id: ruff-check
14+
args: [ --fix ]
15+
16+
- repo: https://github.com/PyCQA/isort
17+
rev: 6.0.1
18+
hooks:
19+
- id: isort
20+
# isort should run before black because black sometimes tweaks isort's output
21+
name: Sort imports with isort
22+
23+
- repo: https://github.com/psf/black
24+
rev: 25.1.0
25+
hooks:
26+
- id: black
27+
name: Format with black
28+
29+
- repo: https://github.com/astral-sh/ruff-pre-commit
30+
rev: v0.12.11
31+
hooks:
32+
# ruff-format should run last as it's the most aggressive formatter
33+
- id: ruff-format

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM python:3.13-slim
2+
WORKDIR /app
3+
COPY src/ /app/src/
4+
COPY pyproject.toml ./
5+
COPY uv.lock ./
6+
RUN pip install uv
7+
RUN uv sync --all-groups
8+
CMD ["uv", "run", "uvicorn", "src.app:app", "--host", "0.0.0.0", "--port", "8000"]

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,24 @@
1-
# summarize
2-
Get summary of a document.
1+
The model is trained and the weights are coming from langchain or huggingface. Deploy the model on server.
2+
3+
# TODO
4+
- make code readable
5+
- tests
6+
- pre-commit hooks
7+
- production ready code
8+
- kubernetes + helm
9+
- CI/CD
10+
- logs
11+
- sentry integration
12+
- validation (max file size, no response, edge cases, etc.)
13+
- make UI?
14+
- OOP?
15+
- save logs to a file?
16+
- cover missing lines in tests
17+
- grafana, datadog?
18+
19+
## Features
20+
- supports different languages
21+
22+
## notes:
23+
install minikube using:
24+
brew install minikube

k8s/deployment.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: summarize-app
5+
spec:
6+
replicas: 3
7+
selector:
8+
matchLabels:
9+
app: summarize
10+
template:
11+
metadata:
12+
labels:
13+
app: summarize
14+
spec:
15+
containers:
16+
- name: summarize
17+
image: summarize-app:latest
18+
imagePullPolicy: IfNotPresent
19+
ports:
20+
- containerPort: 8000

k8s/service.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: summarize-service
5+
spec:
6+
type: LoadBalancer
7+
selector:
8+
app: summarize
9+
ports:
10+
- protocol: TCP
11+
port: 80
12+
targetPort: 8000

pyproject.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[project]
2+
name = "summarize"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.13"
7+
dependencies = [
8+
"fastapi>=0.116.1",
9+
"langchain>=0.3.27",
10+
"langchain-openai>=0.3.32",
11+
"pycryptodome>=3.23.0",
12+
"pypdf>=6.0.0",
13+
"python-dotenv>=1.1.1",
14+
"python-multipart>=0.0.20",
15+
"uvicorn>=0.35.0",
16+
]
17+
18+
[dependency-groups]
19+
dev = [
20+
"pre-commit>=4.3.0",
21+
"pytest>=8.4.1",
22+
"pytest-cov>=6.2.1",
23+
]
24+
25+
[tool.isort]
26+
profile = "black"
27+
multi_line_output = 3
28+
include_trailing_comma = true
29+
force_grid_wrap = 0
30+
use_parentheses = true
31+
ensure_newline_before_comments = true
32+
line_length = 88

src/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)