Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1beed9c
Added API params auth, path and target device
14pankaj Jun 6, 2025
5448590
Added Hf-token as part of API header
14pankaj Jun 9, 2025
cd46218
Added HF-Trasnfer dependency
14pankaj Jun 9, 2025
984a06a
feat:Download and convert multiple models
14pankaj Jun 12, 2025
936c678
feat: Added API docs
14pankaj Jun 12, 2025
90161e9
feat: Added unit testcases & API spec Updated
14pankaj Jun 13, 2025
199ee9a
feat: helm, docker file and documentation Update
14pankaj Jun 17, 2025
745b560
feat: docker file updates
14pankaj Jun 18, 2025
5b01e3c
Merge remote-tracking branch 'origin' into Model_download
14pankaj Jul 1, 2025
af7c0c6
Added ollama hub support to model download
hmkulkarni2001 Jul 7, 2025
4b68206
Docker image size reduction + Minor fixes
hmkulkarni2001 Jul 10, 2025
6d6d8a8
Model_download_ollama
14pankaj Jul 10, 2025
d090159
Added non-root user
hmkulkarni2001 Jul 14, 2025
936b45c
Add revision + rename ovms_config to config
sa10-int Jul 14, 2025
31dee18
Model_download_non_root_change
14pankaj Jul 14, 2025
23cf193
revision & config
14pankaj Jul 14, 2025
913eebd
feat:minor code updates
14pankaj Jul 17, 2025
d474ea1
feat:Model download Updates
14pankaj Jul 17, 2025
dfbf779
feat: VLM model download and compress
14pankaj Jul 25, 2025
70ac2a3
feat: Added Unit testCases
14pankaj Jul 30, 2025
cb8a083
VLM-Integration
14pankaj Sep 1, 2025
9283a8b
Merge remote-tracking branch 'origin' into Model_download
14pankaj Sep 1, 2025
60b334e
feat: Updated Folder structure as per plugin achitecture
14pankaj Sep 9, 2025
7e2bce1
refactor - plugin registry
sa10-int Sep 12, 2025
2a47b63
feat: model download manager
14pankaj Sep 12, 2025
cfb08f2
feat: updated logger
14pankaj Sep 12, 2025
1d81bd7
feat: Updated model manager and ultralytics plugin
14pankaj Sep 15, 2025
a27a7b5
Merge branch 'model_manager' into sa10-model_download_plugin
14pankaj Sep 15, 2025
908356d
refactor - Model download - plugin registry
14pankaj Sep 15, 2025
107853e
Feat: Ultralytics integrated
14pankaj Sep 18, 2025
1833e43
Model Download Microservice
14pankaj Sep 18, 2025
c575a49
plugins + helper functions
sa10-int Sep 18, 2025
d1a510a
Merge branch 'Integration_plugin' into sa10-model_download_plugin
14pankaj Sep 23, 2025
866c7b6
Merge pull request #8 from 14pankaj/sa10-model_download_plugin
14pankaj Sep 23, 2025
c92fa32
feat: Enhanced ollama plugin
14pankaj Sep 24, 2025
74c6cf3
Merge pull request #9 from 14pankaj/Integration_plugin
14pankaj Sep 24, 2025
9cf522a
feat: Updated with huggingface & openvino plugins
14pankaj Sep 26, 2025
78804dd
Merge pull request #10 from 14pankaj/Integration_plugin
14pankaj Sep 26, 2025
68eee4f
Merge branch 'main' into Model-Download_plugin
14pankaj Sep 26, 2025
7e94e34
Feat: OpenVino Plugin Fix
14pankaj Oct 5, 2025
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
32 changes: 32 additions & 0 deletions microservices/model-download/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

# Ignore environment variables
.env

# Ignore Python cache files
__pycache__/
*.py[cod]

# Ignore virtual environment directories
venv/
*.venv/
env/

# Ignore log files
*.log

# Ignore IDE specific files
.vscode/

# Ignore pytest cache
.pytest_cache/

# Ignore pytest result files
*.pytest_cache

# pytest related dir
empty_model_dir
mock_model_dir
.coverage
htmlcov
6 changes: 6 additions & 0 deletions microservices/model-download/chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: genai-model-download
description: A Helm chart for deploying the model-download FastAPI microservice
type: application
version: 0.1.0
appVersion: "1.0.0"
39 changes: 39 additions & 0 deletions microservices/model-download/chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-model-download
labels:
app: {{ .Chart.Name }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ .Chart.Name }}
template:
metadata:
labels:
app: {{ .Chart.Name }}
spec:
containers:
- name: model-download
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 8000
env:
- name: HUGGINGFACE_HUB_CACHE
value: "/root/.cache/huggingface"
- name: HF_HUB_ENABLE_HF_TRANSFER
value: "1"
volumeMounts:
- name: huggingface-cache
mountPath: /root/.cache/huggingface
- name: models
mountPath: /opt/models
volumes:
- name: huggingface-cache
persistentVolumeClaim:
claimName: huggingface-cache-pvc
- name: models
persistentVolumeClaim:
claimName: models-pvc
26 changes: 26 additions & 0 deletions microservices/model-download/chart/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: huggingface-cache-pvc
labels:
app: {{ .Chart.Name }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: models-pvc
labels:
app: {{ .Chart.Name }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
14 changes: 14 additions & 0 deletions microservices/model-download/chart/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-model-download
labels:
app: {{ .Chart.Name }}
spec:
type: NodePort
ports:
- port: 8000
targetPort: 8000
nodePort: {{ .Values.service.nodePort }}
selector:
app: {{ .Chart.Name }}
12 changes: 12 additions & 0 deletions microservices/model-download/chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
replicaCount: 1

image:
repository: your-dockerhub-username/model-download
tag: latest
pullPolicy: IfNotPresent

service:
type: NodePort
nodePort: 32004

resources: {}
24 changes: 24 additions & 0 deletions microservices/model-download/docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**/__pycache__
**/*.pyc
**/*.pyo
**/*.pyd
.Python
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
.git
.gitignore
.pytest_cache
*.egg-info/
dist/
build/
tests/
docs/
models/
**/.cache
**/.coverage
**/.DS_Store
76 changes: 76 additions & 0 deletions microservices/model-download/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# ---- Stage 1: Build dependencies ----
FROM python:3.11-slim AS python-base

# Set the working directory in the container
WORKDIR /app

# Install system dependencies required for Poetry and the application
RUN apt-get update && apt-get install -y \
libgl1 \
libsm6 \
curl \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/*

# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -

# Add Poetry to PATH
ENV PATH="/root/.local/bin:$PATH"

# Install Ollama
RUN curl -fsSL https://ollama.com/install.sh | sh



# Copy only the Poetry configuration files first to leverage Docker caching
COPY pyproject.toml poetry.lock /app/

# Install dependencies using Poetry
RUN poetry config virtualenvs.create false && poetry install --no-root

# ---- Stage 2: Final slim image ----
FROM python:3.11-slim

ARG UID=1000
ARG GID=1000

RUN apt-get update && apt-get install -y \
curl \
libmagic-dev \
libgl1 \
libsm6 \
libglib2.0-0 \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/*

# Create a non-root user
RUN groupadd -g ${GID} appuser && \
useradd -m -s /bin/bash -u ${UID} -g ${GID} appuser

# Copy installed dependencies from python-base
COPY --from=python-base /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=python-base /usr/local/bin /usr/local/bin


COPY . /app

WORKDIR /app

# Change the user of working directory to non-root user
RUN chown -R appuser:appuser /app

# Switch to non-root user
USER appuser

# Expose the port the app runs on
EXPOSE 8000

# Set environment variables
ENV PYTHONPATH=/app
ENV MODELS_DIR=/app/models

# Command to run the application
CMD ["uvicorn", "src.api.main:app", "--host", "0.0.0.0", "--port", "8000"]
17 changes: 17 additions & 0 deletions microservices/model-download/docker/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
services:
model_download_service:
build:
context: ..
dockerfile: docker/Dockerfile
container_name: model_download
environment:
- HF_HUB_ENABLE_HF_TRANSFER=1
- LOG_LEVEL=INFO
ports:
- "8200:8000" # Map container port 8000 to host port 8200
volumes:
# Mount volumes for models and caching
- ~/.cache/huggingface:/home/appuser/.cache/huggingface
- ~/models:/app/models
group_add:
- ${USER_GROUP_ID:-1000}
Loading