Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
e68d338
Fix grpo data preparing
Timik232 Jun 2, 2025
4d62707
DVC initialize
Timik232 Jun 28, 2025
05d7bdd
stop tracking data
Timik232 Jun 28, 2025
897c0d1
Migrate data to dvc
Timik232 Jun 28, 2025
7d4258a
Add Optuna integration for hyperparameter tuning
Timik232 Jun 30, 2025
604dc10
Enhance Optuna hyperparameter optimization
Timik232 Jun 30, 2025
0329ab4
Add vika data, placeholder for new dataset logic
Timik232 Jul 2, 2025
272177b
Update model configuration for Gemma 3-4b
Timik232 Jul 8, 2025
ebb2228
Enable Gemma model support and gradient checkpointing
Timik232 Jul 8, 2025
5ba6b26
Migrate to Ruff for linting and formatting
Timik232 Jul 8, 2025
2268aa0
Improve code readability and maintainability
Timik232 Jul 8, 2025
9b1cf09
Optimize training configuration and dependencies
Timik232 Jul 9, 2025
898df91
Update library versions
Timik232 Aug 9, 2025
3c374a8
Updates model config and adds testing
Timik232 Aug 22, 2025
0a18abe
Configures MLflow as logging backend
Timik232 Aug 27, 2025
0af15ba
Add RKLLM conversion and enhance training pipeline
Timik232 Aug 27, 2025
34f98cb
Restructure testing organization following pytest best practices
Timik232 Aug 27, 2025
00d4c37
Improve sphinx docs
Timik232 Aug 28, 2025
089a951
Make load_dotenv usage optional and configurable
Timik232 Aug 31, 2025
cabb335
feat: implement comprehensive MLflow logging integration for all trai…
Timik232 Aug 31, 2025
7184183
fix: resolve Sphinx documentation configuration issues
Timik232 Aug 31, 2025
1074dfb
chore(pre-commit): apply ruff/black auto-fixes and small safe edits
Timik232 Sep 1, 2025
e7b7900
chore: apply pre-commit hook fixes
Timik232 Sep 1, 2025
1ba714b
Chore: Fix some pre-commit issues, fix rkllm
Timik232 Sep 1, 2025
abf0a1c
build: fix Docker build, try to fix RKLLM converter
Timik232 Sep 2, 2025
99ce0b6
Refactor training pipeline
Timik232 Sep 16, 2025
44590a1
Add logging level to the hydra
Timik232 Sep 16, 2025
f24ab6b
Refactor cleaning garbage and free memory
Timik232 Sep 17, 2025
ad2056b
Add logging for suppression error
Timik232 Sep 17, 2025
7f13228
Fix crossing f-string across lines
Timik232 Sep 17, 2025
317ae7c
Remove duplicating logger
Timik232 Sep 17, 2025
09d3f82
Fix many minor bugs
Timik232 Sep 17, 2025
c50ca28
Chore llama.cpp build with cuda
Timik232 Sep 17, 2025
05471e3
Update Dockerfile_cuda
Timik232 Sep 17, 2025
073ccf2
Update evaluation/deepeval_integration.py
Timik232 Sep 17, 2025
c7d1f58
Fix major bug
Timik232 Sep 17, 2025
f7cc293
Fix model cleaning
Timik232 Sep 17, 2025
5695047
Update rkllm_files/entrypoint.sh
Timik232 Sep 18, 2025
241a24c
Fix tests/unit/test_dpo_grpo.py argument mismatch
Timik232 Sep 18, 2025
62c7d57
Fix tests/unit/test_dpo_grpo.py order mismatch
Timik232 Sep 18, 2025
2c23864
Update testing_model/models.py to fix async
Timik232 Sep 18, 2025
1256b3d
Fix training_model/optimizer_factory.py adam-mini usage
Timik232 Sep 18, 2025
fa88120
Update training_model/dpo_train.py to validate incorrect config
Timik232 Sep 18, 2025
d18b2e1
Remove cwd training_model/__main__.py
Timik232 Sep 18, 2025
979a003
Fix prompt extraction training_model/data_preparation.py
Timik232 Sep 18, 2025
6028e60
Many different minor fixes
Timik232 Sep 18, 2025
1acdd70
Merge pull request #8 from Timik232/vika-dog-mirea
Timik232 Sep 18, 2025
2e90881
Revert one_file_train.py to previous working state
Timik232 Sep 18, 2025
a15727e
Delete legacy, fix readme
Timik232 Sep 19, 2025
2239957
Fix readme links
Timik232 Sep 19, 2025
df661c9
Fix headers for github in readme
Timik232 Sep 19, 2025
ea163f2
chore: generation fixes, add data
Timik232 Oct 21, 2025
b06eeec
fix: grpo fix bloat16
Timik232 Oct 22, 2025
aa9b707
feat: Improve grpo reward function
Timik232 Oct 23, 2025
90e5d18
feat: Add vllm support, improve optuna
Timik232 Oct 23, 2025
9635a97
feat: add optuna logging
Timik232 Oct 23, 2025
040f19a
feat: add tools to dataset analyze
Timik232 Oct 23, 2025
e13ae38
feat: integrate DeepEval metrics into testing pipeline
Timik232 Oct 23, 2025
a98c559
feat: significantly increased speed of the tests
Timik232 Oct 25, 2025
ab5b659
feat: Add nicer summary for tests
Timik232 Oct 27, 2025
831e7d3
chore: replace thread for async
Timik232 Oct 27, 2025
2661aaf
Update evaluation/game_evaluation.py
Timik232 Oct 30, 2025
c348a98
Merge branch 'main' into develop
Timik232 Oct 30, 2025
b3cdc73
fix: update MLflow tracking URI and fix lint errors for PR #9
Timik232 Jun 15, 2026
15a80c8
fix: resolve remaining lint errors for PR #9
Timik232 Jun 15, 2026
bee84ef
fix: sort imports in utils.py (I001 unsorted-imports)
Timik232 Jun 15, 2026
9494384
fix: apply ruff isort sorting to utils.py and one_file_train.py
Timik232 Jun 15, 2026
539fb57
Configure DVC S3 remote (MinIO) and retrack data
Timik232 Jun 15, 2026
0a32982
fix: add ruff isort known-first-party for deterministic import sorting
Timik232 Jun 15, 2026
9cc6037
fix: reorder imports per CI ruff isort (force-sort-within-sections)
Timik232 Jun 15, 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
3 changes: 3 additions & 0 deletions .dvc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/config.local
/tmp
/cache
11 changes: 11 additions & 0 deletions .dvc/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[cache]
type = hardlink
protected = true
[core]
remote = storage
['remote "nas-remote"']
url = //diskstation_105/dvc_storage
['remote "storage"']
url = s3://dvc-storage
endpointurl = https://minio.komolov.synology.me
region = us-east-1
3 changes: 3 additions & 0 deletions .dvcignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Add patterns of files dvc should ignore, which could improve
# the performance. Learn more at
# https://dvc.org/doc/user-guide/dvcignore
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,32 @@ yandex8b-chat-vika
vikhr8b-chat-vika
judge-model
models/
data/

flash-attention

.serena/

.claude/

4b-chat-vika/

best_config.yaml

CLAUDE.md

.github/instructions/

design.md

tasks.md
/data

node_modules/npm/

node_modules/

.deepeval/

gptchain/
db/
65 changes: 50 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,72 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-ast
description: Check Python AST syntax
- id: check-case-conflict
description: Check for case conflicts in filenames
- id: check-toml
description: Validate TOML files
- id: check-yaml
description: Validate YAML files
args: ['--unsafe'] # Allow custom YAML tags used by Hydra
- id: check-json
description: Validate JSON files
- id: detect-private-key
description: Detect private keys in code
- id: end-of-file-fixer
exclude: '.*\.sh$'
description: Fix missing newlines at end of files
exclude: '.*\.(sh|bat)$'
- id: trailing-whitespace
description: Remove trailing whitespace
exclude: '.*\.(md|rst)$' # Preserve markdown line breaks
- id: check-added-large-files
description: Check for large files being committed
args: ['--maxkb=10240'] # Allow up to 10MB files
- id: check-merge-conflict
description: Check for merge conflict markers
- id: debug-statements
description: Check for debug statements (pdb, etc.)
language: python
- id: mixed-line-ending
description: Check for mixed line endings

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.5
rev: v0.8.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes, --select, I]
name: ruff-linter
description: Run Ruff linter with auto-fixes
args: [--fix, --show-fixes, --config=pyproject.toml]
- id: ruff-format
name: ruff-formatter
description: Run Ruff formatter
args: [--config=pyproject.toml]

- repo: https://github.com/psf/black
rev: 23.1.0
rev: 24.10.0
hooks:
- id: black
args: [--fast]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.0
name: black-formatter
description: Format Python code with Black
language_version: python3


- repo: https://github.com/pycqa/bandit
rev: 1.7.10
hooks:
- id: bandit
name: bandit-security-checker
description: Run Bandit security linter
args: [-c, pyproject.toml]
exclude: ^(tests/|legacy)

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: flake8
additional_dependencies: [pep8-naming, flake8-bugbear ]
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: 'v1.15.0'
# hooks:
# - id: mypy
# args: [ --strict ]
- id: codespell
name: codespell-spell-checker
description: Check for common misspellings
args: [--write-changes]
exclude: ^(\.git/|docs/_build/|models/|data/|README.md)
4 changes: 1 addition & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2

sphinx:
configuration: docs/conf.py

python:
install:
- requirements: requirements.txt
Expand All @@ -14,5 +14,3 @@ build:
jobs:
pre_install:
- pip install --upgrade pip


42 changes: 31 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04

ENV DEBIAN_FRONTEND=noninteractive

Expand All @@ -16,8 +16,12 @@ RUN apt-get update && \
build-essential \
cmake \
curl \
wget \
jq \
libcurl4-openssl-dev \
apt-transport-https \
ca-certificates \
gnupg \
&& \
rm -rf /var/lib/apt/lists/*

Expand All @@ -27,24 +31,40 @@ RUN python3.11 -m ensurepip && python3.11 -m pip install --upgrade pip

RUN pip install --upgrade --ignore-installed wheel==0.45.1

WORKDIR /training_model
COPY pyproject.toml poetry.lock ./
RUN pip install poetry && poetry config virtualenvs.create false && poetry install --no-root --only main

COPY training_model ./training_model
COPY testing_model ./testing_model
COPY data ./data
COPY main.py .
# Install Docker CLI so the training container can control Docker to run the RKLLM converter
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
> /etc/apt/sources.list.d/docker.list && \
apt-get update && apt-get install -y docker-ce-cli && rm -rf /var/lib/apt/lists/*
Comment on lines +34 to +39

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Docker-in-Docker pattern requires security consideration.

Installing Docker CLI allows the training container to control the host Docker daemon (typically via mounted /var/run/docker.sock). This grants the container significant privileges and should be carefully controlled.

Ensure that:

  1. The socket mount is only enabled when RKLLM conversion is needed
  2. Access is restricted in production environments
  3. Alternative approaches (e.g., separate conversion service) have been considered

If docker-compose.yaml mounts the socket, verify it's conditionally enabled:


🏁 Script executed:

#!/bin/bash
# Check if docker-compose.yaml mounts docker.sock
rg -n "docker.sock" docker-compose.yaml docker-compose.yml

Length of output: 131


🏁 Script executed:

#!/bin/bash
# Examine docker-compose.yaml around line 47 to understand context
sed -n '35,55p' docker-compose.yaml

Length of output: 456


🏁 Script executed:

#!/bin/bash
# View entire docker-compose.yaml to understand service structure
cat docker-compose.yaml

Length of output: 1337


🏁 Script executed:

#!/bin/bash
# Check if Dockerfile contains any docker commands/usage
rg -n "docker" Dockerfile | head -20

Length of output: 420


Docker socket mount is unconditional and should be restricted to converter operations only.

The socket mount on llm_training service (docker-compose.yaml line 47) is enabled unconditionally with full read-write access, despite the Dockerfile comment stating it's only needed for RKLLM converter. The converter runs as a separate gated service (profiles: ["converter"]) but lacks the socket mount, creating an inconsistent and over-privileged setup.

Fix required:

  • Either mount the socket only on rkllm_converter service (with conditional profile), OR
  • Conditionally enable the mount on llm_training via profiles/environment variable when conversion is needed

This ensures the host Docker daemon is only accessible when necessary.


WORKDIR /llama.cpp
RUN git clone https://github.com/ggml-org/llama.cpp.git . && \
cmake -B build && \
cmake --build build --config Release

WORKDIR /training_model

WORKDIR /app
COPY pyproject.toml poetry.lock ./
RUN pip install poetry && \
pip install pyyaml && \
poetry lock --no-interaction --no-ansi || true && \
poetry install --no-root --only main --no-interaction --no-ansi
Comment on lines +48 to +52

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Poetry lock failure silently ignored.

Line 51 uses || true to ignore poetry lock failures. This may lead to inconsistent dependencies across container builds, as lock file generation errors won't be detected.

Consider handling lock failures more explicitly:

# Try to use existing lock, but allow regeneration if corrupted
RUN pip install poetry && \
    pip install pyyaml && \
    (poetry lock --check || poetry lock --no-interaction --no-ansi) && \
    poetry install --no-root --only main --no-interaction --no-ansi
🤖 Prompt for AI Agents
Dockerfile around lines 48 to 52: the Dockerfile currently silences poetry lock
failures with "|| true", which can hide dependency lock issues and produce
inconsistent builds; replace the silent ignore with an explicit check/regenerate
flow so the build either validates the existing lock or regenerates it, e.g.,
run poetry lock --check and if that fails run poetry lock --no-interaction
--no-ansi, then run poetry install, and do not swallow errors so the build fails
on unexpected lock errors.


# Create symlink for llama.cpp so training code can find it at expected relative path
RUN ln -s /llama.cpp ./llama.cpp

# Create symlink for quantize executable to match Windows naming convention
RUN ln -s /llama.cpp/build/bin/llama-quantize /app/llama.cpp/llama-quantize.exe
Comment on lines +57 to +58

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify .exe extension requirement on Linux.

The symlink creates llama-quantize.exe in a Linux container, which is unusual. The comment mentions matching Windows naming convention, suggesting the calling code expects this exact filename.

Verify whether training_model code hardcodes the .exe extension or if this can be made platform-aware:


🏁 Script executed:

#!/bin/bash
# Check for hardcoded .exe references in training code
rg -n "llama-quantize\.exe" training_model/

Length of output: 218


I need to examine the broader context around these hardcoded references to see if there's platform detection logic or if the parameter can be overridden:

</parameter>
</invoke>

---

🏁 Script executed:

```shell
#!/bin/bash
# Check context around the hardcoded .exe references
rg -n -B5 -A5 "llama-quantize\.exe" training_model/one_file_train.py

Length of output: 924


🏁 Script executed:

#!/bin/bash
# Check function signature and how quantized_path is used
ast-grep --pattern $'def $_($$$quantized_path$$$) {
  $$$
}'

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Search for platform detection or conditional logic related to quantize
rg -n -i "platform|windows|linux|os\." training_model/one_file_train.py | head -20

Length of output: 1039


I need to check how this function is called to see if the parameter is being overridden or if it relies on the default:

</parameter>
</invoke>

---

🏁 Script executed:

```shell
#!/bin/bash
# Find all calls to quantize_model function
rg -n "quantize_model\(" training_model/ --type=py

Length of output: 138


🏁 Script executed:

#!/bin/bash
# Check if there are any tests or other references to the quantized_path parameter
rg -n "quantized_path\s*=" training_model/ --type=py

Length of output: 102


🏁 Script executed:

#!/bin/bash
# Look for platform detection at top level or imports
head -50 training_model/one_file_train.py | grep -n "import\|platform\|sys"

Length of output: 906


I need to check what the config actually contains for the quantized_path value:

</parameter>
</invoke>

---

🏁 Script executed:

```shell
#!/bin/bash
# Find config structure definition
rg -n "quantized_path" training_model/ --type=py -B2 -A2

Length of output: 1646


🏁 Script executed:

#!/bin/bash
# Look for config file or config defaults
fd -type f -name "*.yaml" -o -name "*.yml" -o -name "*config*" training_model/ 2>/dev/null | head -10

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check context around line 1836-1841 to see full function call
sed -n '1830,1845p' training_model/one_file_train.py

Length of output: 761


Let me search for the config definition at the project level:

</parameter>
</invoke>

---

🏁 Script executed:

```shell
#!/bin/bash
# Search for config.yaml or similar at project root
find . -maxdepth 2 -type f \( -name "*.yaml" -o -name "*.yml" -o -name "config.py" \) 2>/dev/null | head -20

Length of output: 105


🏁 Script executed:

#!/bin/bash
# Search for where cfg.paths.quantized_path is defined
rg -n "quantized_path.*=" . --type=py --type=yaml | grep -v "^training_model"

Length of output: 383


🏁 Script executed:

#!/bin/bash
# Look in parent dirs and common config locations
rg -n "paths:" . --type=yaml -A5 | head -30

Length of output: 313


</parameter>
</invoke>

---

🏁 Script executed:

```shell
#!/bin/bash
# Read the full paths section from config.yaml
sed -n '163,180p' ./conf/config.yaml

Length of output: 604


🏁 Script executed:

#!/bin/bash
# Look for quantized_path in entire config.yaml
cat ./conf/config.yaml | grep -n "quantized_path" -B2 -A2

Length of output: 268


Fix hardcoded .exe extension in error message and config assumptions.

The .exe extension is hardcoded in two places with design issues:

  1. conf/config.yaml (line 175): Config sets quantized_path: "llama-quantize.exe", but the commented alternative on line 174 shows platform variations are expected. Tests (test_training_functions.py lines 302, 327) use the platform-neutral "llama-quantize" without .exe, creating inconsistency.

  2. training_model/one_file_train.py (line 1709): Error message hardcodes "llama-quantize.exe" as a string literal, but the actual executable path comes from the quantized_path parameter. If the config ever changes, the error message will be misleading.

The Dockerfile symlink on line 58 is a workaround for these hardcoded assumptions. Either make the naming truly platform-aware throughout or document that .exe is required specifically for the Docker environment.

🤖 Prompt for AI Agents
Dockerfile lines 57-58: the symlink creation is compensating for a hardcoded
".exe" assumption elsewhere; remove the workaround by making the executable name
platform-neutral across the codebase: set conf/config.yaml quantized_path to
"llama-quantize" (or derive it at runtime based on platform), update
training_model/one_file_train.py to reference the quantized_path parameter in
its error message instead of the literal "llama-quantize.exe", and update tests
to use the platform-neutral name; alternatively, if Docker must provide a
Windows-named binary, change the Dockerfile to create both names (llama-quantize
and llama-quantize.exe) or document the requirement—pick one approach and make
the changes consistently.


COPY training_model ./training_model
COPY testing_model ./testing_model
COPY evaluation ./evaluation
COPY data ./data
COPY conf ./conf
COPY main.py .
COPY run_pipeline.sh .

RUN chmod +x run_pipeline.sh

CMD ["./run_pipeline.sh"]
#CMD python -m training_model
11 changes: 5 additions & 6 deletions Dockerfile_cuda
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ RUN python3.11 -m ensurepip && python3.11 -m pip install --upgrade pip

RUN pip install --upgrade --ignore-installed wheel==0.45.1

WORKDIR /llama.cpp
RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
git clone https://github.com/ggml-org/llama.cpp.git . && \
LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH cmake -S . -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release && \
LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH cmake --build build --config Release -- -j"$(nproc)"
WORKDIR /training_model
COPY pyproject.toml poetry.lock ./
RUN pip install poetry && poetry config virtualenvs.create false && poetry install --no-root --only main
Expand All @@ -32,12 +37,6 @@ COPY testing_model ./testing_model
COPY data ./data
COPY main.py .

WORKDIR /llama.cpp
RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
git clone https://github.com/ggml-org/llama.cpp.git . && \
LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH cmake -B build -DGGML_CUDA=ON && \
LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH cmake --build build --config Release

WORKDIR /training_model

CMD python -m training_model
6 changes: 3 additions & 3 deletions Dockerfile_ollama
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ FROM ollama/ollama:latest

RUN apt-get update && apt-get install -y curl

VOLUME ["/root/.ollama", "/training_model/models"]
RUN mkdir -p /training_model/models && chmod 777 /training_model/models
VOLUME ["/root/.ollama", "/app/models"]
RUN mkdir -p /app/models && chmod 777 /app/models

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Overly permissive directory permissions pose a security risk.

Setting permissions to 777 grants read, write, and execute access to all users, which violates the principle of least privilege and could allow unauthorized modifications.

Apply this diff to use more restrictive permissions:

-RUN mkdir -p /app/models && chmod 777 /app/models
+RUN mkdir -p /app/models && chmod 755 /app/models

If write access by the Ollama process is required, consider using 775 with appropriate group ownership instead of world-writable permissions.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RUN mkdir -p /app/models && chmod 777 /app/models
RUN mkdir -p /app/models && chmod 755 /app/models
🤖 Prompt for AI Agents
In Dockerfile_ollama around line 6, the RUN command currently sets overly
permissive 777 on /app/models; change this to create the directory, set
ownership to the user/group that the Ollama process runs as, and use restrictive
permissions (e.g. 775) so only owner/group can write while others are
read/execute. Ensure the Dockerfile uses chown to assign the directory to the
Ollama runtime user/group before or when setting permissions and avoid
world-writable mode.


EXPOSE 11434

ENV OLLAMA_MODELS="/training_model/models"
ENV OLLAMA_MODELS="/app/models"

COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
Expand Down
Loading
Loading