Skip to content
Merged

exp #58

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
de5c112
feat(ci): optimize workflow pipeline and update docker configurations
Eamon2009 May 29, 2026
e91fff5
feat(ci): optimize workflow pipeline and update docker configurations
Eamon2009 May 29, 2026
576c2b8
feat(ci): optimize workflow pipeline and update docker configurations
Eamon2009 May 29, 2026
f1e4bb8
feat(ci): optimize workflow pipeline and update docker configurations
Eamon2009 May 29, 2026
43d51c8
feat(ci): optimize workflow pipeline and update docker configurations
Eamon2009 May 29, 2026
d96de27
feat(ci): optimize workflow pipeline and update docker configurations
Eamon2009 May 29, 2026
c7d669b
feat(ci): optimize workflow pipeline and update docker configurations
Eamon2009 May 29, 2026
a652ec8
feat(ci): optimize workflow pipeline and update docker configurations
Eamon2009 May 29, 2026
ebd8e20
refactor(ci): optimize workflow pipeline and update docker configurat…
Eamon2009 May 29, 2026
c2d78c8
refactor : optimize workflow pipeline and update docker configurations
Eamon2009 May 29, 2026
ff173b4
refactor : optimize workflow pipeline and update docker configurations
Eamon2009 May 29, 2026
8db6cd1
refactor : optimize workflow pipeline and update docker configurations
Eamon2009 May 29, 2026
07288d9
Added MIT LICENSE to this project Quadtrix.cpp
Eamon2009 May 29, 2026
d01af15
Refactor Dockerfile to use ARG for CUDA version
codeaddict-119 May 29, 2026
ed37774
Refactor Dockerfile for backend dependencies
codeaddict-119 May 29, 2026
ab46bde
Refactor Dockerfile to use ARG for CUDA version (#57)
Eamon2009 May 29, 2026
068cdb7
refactor : Dockerfile.backend optimize workflow pipeline
Eamon2009 May 29, 2026
07826e1
refactor : Dockerfile.backend optimize workflow pipeline
Eamon2009 May 29, 2026
7f4d25a
refactor : Dockerfile.backend optimize workflow pipeline
Eamon2009 May 29, 2026
dcd14e1
refactor : Dockerfile.backend optimize workflow pipeline
Eamon2009 May 29, 2026
2139c1d
Delete .devops/Dockerfile.frontend
Eamon2009 May 29, 2026
74b46ec
Delete .devops/Dockerfile.dev.frontend
Eamon2009 May 29, 2026
0770909
refactor : Dockerfile.backend optimize workflow pipeline
Eamon2009 May 29, 2026
f0ae40b
refactor : Dockerfile.backend optimize workflow pipeline
Eamon2009 May 29, 2026
9f909f4
refactored (CI): consolidated manual Docker build jobs into a matrix …
Eamon2009 May 29, 2026
0ff70b2
refactored (CI): consolidated manual Docker build jobs into a matrix …
Eamon2009 May 29, 2026
31e960d
refactor(ui): rewrite ThinkingIndicator to use inline styles and CSS …
Eamon2009 May 30, 2026
31ef90d
refactor : message bubble layout to use inline styles
Eamon2009 May 30, 2026
9b19a92
refactor(ui): complete inline-style migration and update auto-scroll …
Eamon2009 May 30, 2026
250b2fc
refactor(ui): complete inline-style migration for MessageAvatar compo…
Eamon2009 May 30, 2026
7e4270d
refactor(ui): rewrite EmptyState component using pure inline styles
Eamon2009 May 30, 2026
5e05bec
refactored(tensor): vectorize element-wise addition and scalar scalin…
Eamon2009 May 30, 2026
8149064
refactor(main): redesign training loop to log per-step and sample dur…
Eamon2009 May 30, 2026
b188e6b
feat: implement GPT training loop with multi-GPU and memory optimizat…
Eamon2009 May 30, 2026
6519631
Update README.md with new banner for qudtrix.cpp
Eamon2009 May 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile → .devops/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ COPY . .
ENV PATH="/app/venv/bin:$PATH"
ENV PYTHONUNBUFFERED=1

ENTRYPOINT ["python3", "engine/main.py"]
ENTRYPOINT ["python3", "engine/main.py"]
File renamed without changes.
65 changes: 65 additions & 0 deletions .devops/Dockerfile.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

FROM ubuntu:24.04 AS builder

LABEL stage=builder

ARG DEBIAN_FRONTEND=noninteractive
ARG BUILD_TYPE=Release
ARG CMAKE_EXTRA_FLAGS=""

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
g++ \
cmake \
ninja-build \
ccache \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /src

COPY main.cpp ./
COPY benchmark.cpp ./
COPY config/ ./config/
COPY include/ ./include/
COPY data/ ./data/

# If model/Cmakelists.txt exists, use cmake; else fall back to direct g++
RUN set -e; \
if [ -f model/Cmakelists.txt ] || [ -f CMakeLists.txt ]; then \
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
${CMAKE_EXTRA_FLAGS} .; \
cmake --build build --parallel "$(nproc)"; \
else \
g++ -std=c++17 -O3 -march=native \
-I. -Iinclude \
-o /usr/local/bin/quadtrix \
main.cpp; \
fi
FROM ubuntu:24.04 AS runtime

LABEL org.opencontainers.image.title="Quadtrix.cpp Engine"
LABEL org.opencontainers.image.description="C++ transformer engine for local LM inference"
LABEL org.opencontainers.image.source="https://github.com/Eamon2009/Quadtrix.cpp"

RUN apt-get update && apt-get install -y --no-install-recommends \
libstdc++6 \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY --from=builder /usr/local/bin/quadtrix /usr/local/bin/quadtrix
COPY --from=builder /src/data/ ./data/
VOLUME ["/models"]

ENV GPT_DATA_PATH=/app/data/input.txt \
GPT_MODEL_PATH=/models/best_model.bin

EXPOSE 8080

ENTRYPOINT ["/usr/local/bin/quadtrix"]
CMD ["data/input.txt", "--chat"]
47 changes: 47 additions & 0 deletions .devops/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Quadtrix.cpp — Nginx config
# Serves the Vite SPA and proxies /api/* to the FastAPI backend

server {
listen 80;
server_name _;

root /usr/share/nginx/html;
index index.html;

# Gzip
gzip on;
gzip_types text/plain text/css application/json application/javascript
text/xml application/xml application/xml+rss text/javascript
application/wasm;
gzip_min_length 1024;

# SPA fallback — all unknown routes return index.html
location / {
try_files $uri $uri/ /index.html;
}

# Proxy API calls to FastAPI backend
location /api/ {
proxy_pass http://backend:3001;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 120s;
proxy_send_timeout 120s;
}

# Static asset cache
location ~* \.(js|css|png|svg|ico|woff2|woff|ttf|webmanifest)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}

# Service worker must not be cached
location = /sw.js {
add_header Cache-Control "no-cache";
}
}
57 changes: 33 additions & 24 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@

.git
.gitignore
.github
.venv
**/__pycache__
**/*.pyc
**/*.pyo
**/*.pyd
engine/logs/
__pycache__
*.pyc
*.pyo
*.pyd
*.egg-info
.pytest_cache
.ruff_cache
dist/
build/
*.egg
node_modules
frontend/node_modules
.npm-cache
frontend/.vite
frontend/dist

# Model weights
*.pt
*.bin
models/

# Windows build artifacts
*.exe
frontend/.vite
*.npm-cache
.npmignore
*.o
*.a
*.so
*.dylib
quadtrix.exe
*.png
*.jpg
*.jpeg
*.md
LICENSE
contributing.md
SECURITY.md
run.md
quadtrix
build/
cmake-build-*/
.vscode
*.bin
*.pt
*.gguf
*.safetensors
engine/best_model.pt
engine/logs/
engine/fineweb_30mb.txt
data/input.txt
.DS_Store
Thumbs.db
*.swp
*.swo
.idea
.vscode
docker-compose.override.yml
Loading
Loading