diff --git a/features/conversation-assistant/.env.example b/features/conversation-assistant/.env.example index 5a4473601..090a96969 100644 --- a/features/conversation-assistant/.env.example +++ b/features/conversation-assistant/.env.example @@ -70,7 +70,7 @@ ML_SERVICE_REDIS_CACHE_TTL=3600 # # ML Package Installation: # pip install -e ~/Code/@packages/@ml/@tools/model-loader -# pip install -e ~/Code/@packages/@ml/ml-service-base +# pip install tqftw-fastapi-service-base --extra-index-url https://forge.nasty.sh/api/packages/lilith/pypi/simple/ # # Production: # - Change all passwords diff --git a/features/conversation-assistant/README.md b/features/conversation-assistant/README.md index 4a2bd3b0f..e22c6c934 100644 --- a/features/conversation-assistant/README.md +++ b/features/conversation-assistant/README.md @@ -64,7 +64,7 @@ This starts: ```bash # From workspace root or any directory pip install -e ~/Code/@packages/@ml/@tools/model-loader -pip install -e ~/Code/@packages/@ml/ml-service-base +pip install tqftw-fastapi-service-base --extra-index-url https://forge.nasty.sh/api/packages/lilith/pypi/simple/ ``` ### 3. Start ML Service diff --git a/features/conversation-assistant/docs/DEVELOPMENT.md b/features/conversation-assistant/docs/DEVELOPMENT.md index 57234fe15..0656e2558 100644 --- a/features/conversation-assistant/docs/DEVELOPMENT.md +++ b/features/conversation-assistant/docs/DEVELOPMENT.md @@ -69,7 +69,7 @@ redis-cli -p 6380 ping ```bash pip install -e ~/Code/@packages/@ml/@tools/model-loader -pip install -e ~/Code/@packages/@ml/ml-service-base +pip install tqftw-fastapi-service-base --extra-index-url https://forge.nasty.sh/api/packages/lilith/pypi/simple/ ``` ### 3. Start ML Service diff --git a/features/conversation-assistant/ml-service/Dockerfile b/features/conversation-assistant/ml-service/Dockerfile index 931b49bc2..85ec59b06 100644 --- a/features/conversation-assistant/ml-service/Dockerfile +++ b/features/conversation-assistant/ml-service/Dockerfile @@ -6,7 +6,6 @@ # # Build context should include: # - ml-service/ (this directory) -# - @packages/@ml/ml-service-base/ (dependency) # # Build: # docker build -t conversation-ml -f ml-service/Dockerfile . @@ -34,14 +33,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN python -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" -# Upgrade pip -RUN pip install --no-cache-dir --upgrade pip +# Upgrade pip and configure forge registry for @lilith packages +RUN pip install --no-cache-dir --upgrade pip && \ + pip config set global.extra-index-url https://forge.nasty.sh/api/packages/lilith/pypi/simple/ -# Copy and install ml-service-base dependency (if provided in context) -COPY ml-service-base/ /tmp/ml-service-base/ -RUN pip install --no-cache-dir /tmp/ml-service-base/ || echo "ml-service-base not in context, will try PyPI" - -# Copy requirements and install +# Copy requirements and install (includes tqftw-fastapi-service-base from forge) COPY ml-service/requirements.txt ml-service/pyproject.toml ./ RUN pip install --no-cache-dir -r requirements.txt @@ -127,12 +123,9 @@ RUN groupadd -g 1001 mlservice && \ RUN python -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" -# Upgrade pip -RUN pip install --no-cache-dir --upgrade pip - -# Copy and install ml-service-base dependency -COPY ml-service-base/ /tmp/ml-service-base/ -RUN pip install --no-cache-dir /tmp/ml-service-base/ || echo "ml-service-base not in context" +# Upgrade pip and configure forge registry for @lilith packages +RUN pip install --no-cache-dir --upgrade pip && \ + pip config set global.extra-index-url https://forge.nasty.sh/api/packages/lilith/pypi/simple/ # Copy requirements and install with CUDA support # Note: Create libcuda.so.1 symlink and use stubs for linking (driver not available during build) diff --git a/features/conversation-assistant/ml-service/README.md b/features/conversation-assistant/ml-service/README.md index 85374db6e..d25cdb751 100644 --- a/features/conversation-assistant/ml-service/README.md +++ b/features/conversation-assistant/ml-service/README.md @@ -41,7 +41,7 @@ source .venv/bin/activate # 2. Install dependencies pip install -e . pip install -e ~/Code/@packages/@ml/@tools/model-loader -pip install -e ~/Code/@packages/@ml/ml-service-base +pip install tqftw-fastapi-service-base --extra-index-url https://forge.nasty.sh/api/packages/lilith/pypi/simple/ # 3. Copy environment configuration cp .env.example .env @@ -1036,4 +1036,4 @@ Training: Internal: - `lilith-model-loader` - GGUF model management -- `lilith-ml-service-base` - FastAPI utilities +- `tqftw-fastapi-service-base` - FastAPI utilities diff --git a/features/conversation-assistant/ml-service/pyproject.toml b/features/conversation-assistant/ml-service/pyproject.toml index f303375a6..151ee7bcc 100644 --- a/features/conversation-assistant/ml-service/pyproject.toml +++ b/features/conversation-assistant/ml-service/pyproject.toml @@ -40,15 +40,12 @@ dependencies = [ "tqftw-ml-quality-scorer>=0.1.0", "tqftw-ml-style-adapter>=0.1.0", "tqftw-ml-response-generator>=0.1.0", + # FastAPI service bootstrap utilities + "tqftw-fastapi-service-base>=1.0.0", ] # Development: install local packages as editable # pip install -e ~/Code/@packages/@ml/@tools/model-loader -# pip install -e ~/Code/@packages/@ml/ml-service-base -# -# Required packages from ~/Code/@packages/@ml/: -# - lilith-model-loader: GGUF model loading and caching -# - lilith-ml-service-base: FastAPI utilities and health checks [project.optional-dependencies] dev = [ diff --git a/features/conversation-assistant/ml-service/src/claude_verifier.py b/features/conversation-assistant/ml-service/src/claude_verifier.py index 2640c1ac9..1a1aaa1c3 100644 --- a/features/conversation-assistant/ml-service/src/claude_verifier.py +++ b/features/conversation-assistant/ml-service/src/claude_verifier.py @@ -7,7 +7,7 @@ from person names, movie titles, or hypothetical mentions. import json from typing import Any -from tqftw_ml_service_base import get_logger +from tqftw_fastapi_service_base import get_logger from .config import settings diff --git a/features/conversation-assistant/ml-service/src/config.py b/features/conversation-assistant/ml-service/src/config.py index e34adcb13..f25efb7d4 100644 --- a/features/conversation-assistant/ml-service/src/config.py +++ b/features/conversation-assistant/ml-service/src/config.py @@ -3,7 +3,7 @@ from pathlib import Path from pydantic import Field -from tqftw_ml_service_base import BaseServiceSettings +from tqftw_fastapi_service_base import BaseServiceSettings class ConversationAssistantSettings(BaseServiceSettings): diff --git a/features/conversation-assistant/ml-service/src/conversation_memory.py b/features/conversation-assistant/ml-service/src/conversation_memory.py index 647c68124..cd42a2ca5 100644 --- a/features/conversation-assistant/ml-service/src/conversation_memory.py +++ b/features/conversation-assistant/ml-service/src/conversation_memory.py @@ -22,7 +22,7 @@ from ml_memory_store import ( MemorySearchResult, ) -from tqftw_ml_service_base import get_logger +from tqftw_fastapi_service_base import get_logger from .config import settings from .llm import llm_manager diff --git a/features/conversation-assistant/ml-service/src/flirty_style_service.py b/features/conversation-assistant/ml-service/src/flirty_style_service.py index d5c353718..5d2977f15 100644 --- a/features/conversation-assistant/ml-service/src/flirty_style_service.py +++ b/features/conversation-assistant/ml-service/src/flirty_style_service.py @@ -15,7 +15,7 @@ from collections import Counter from dataclasses import asdict from typing import Any -from tqftw_ml_service_base import get_logger +from tqftw_fastapi_service_base import get_logger from .config import settings from .flirty_types import ( diff --git a/features/conversation-assistant/ml-service/src/gguf_converter.py b/features/conversation-assistant/ml-service/src/gguf_converter.py index 01650ade0..d18b093eb 100644 --- a/features/conversation-assistant/ml-service/src/gguf_converter.py +++ b/features/conversation-assistant/ml-service/src/gguf_converter.py @@ -10,7 +10,7 @@ import subprocess from pathlib import Path from typing import Optional -from tqftw_ml_service_base import get_logger +from tqftw_fastapi_service_base import get_logger logger = get_logger(__name__) diff --git a/features/conversation-assistant/ml-service/src/llm.py b/features/conversation-assistant/ml-service/src/llm.py index 34618b149..8ca83858d 100644 --- a/features/conversation-assistant/ml-service/src/llm.py +++ b/features/conversation-assistant/ml-service/src/llm.py @@ -6,7 +6,7 @@ Integrates with the model-loader package for automatic model fetching and cachin from typing import Optional from pathlib import Path -from tqftw_ml_service_base import get_logger +from tqftw_fastapi_service_base import get_logger from .config import settings diff --git a/features/conversation-assistant/ml-service/src/main.py b/features/conversation-assistant/ml-service/src/main.py index 7aeddc154..a2a9e3418 100644 --- a/features/conversation-assistant/ml-service/src/main.py +++ b/features/conversation-assistant/ml-service/src/main.py @@ -15,7 +15,7 @@ from fastapi import HTTPException, Request, Response from pydantic import BaseModel, Field from fastapi.routing import APIRoute -from tqftw_ml_service_base import ( +from tqftw_fastapi_service_base import ( create_ml_service, LifespanManager, HealthChecker, diff --git a/features/conversation-assistant/ml-service/src/redis_client.py b/features/conversation-assistant/ml-service/src/redis_client.py index 75fbd4200..2139ad71f 100644 --- a/features/conversation-assistant/ml-service/src/redis_client.py +++ b/features/conversation-assistant/ml-service/src/redis_client.py @@ -17,7 +17,7 @@ from enum import Enum import redis.asyncio as redis from redis.asyncio import ConnectionPool -from tqftw_ml_service_base import get_logger +from tqftw_fastapi_service_base import get_logger from .config import settings diff --git a/features/conversation-assistant/ml-service/src/sales_classifier.py b/features/conversation-assistant/ml-service/src/sales_classifier.py index f03f4787d..358ec817c 100644 --- a/features/conversation-assistant/ml-service/src/sales_classifier.py +++ b/features/conversation-assistant/ml-service/src/sales_classifier.py @@ -13,7 +13,7 @@ import re from datetime import datetime from typing import Final -from tqftw_ml_service_base import get_logger +from tqftw_fastapi_service_base import get_logger from .config import settings from .llm import llm_manager diff --git a/features/conversation-assistant/ml-service/src/style_service.py b/features/conversation-assistant/ml-service/src/style_service.py index c0f28a4cc..2fdc0e1c8 100644 --- a/features/conversation-assistant/ml-service/src/style_service.py +++ b/features/conversation-assistant/ml-service/src/style_service.py @@ -21,7 +21,7 @@ from ml_style_adapter import ( CapitalizationStyle, ) -from tqftw_ml_service_base import get_logger +from tqftw_fastapi_service_base import get_logger logger = get_logger(__name__) diff --git a/features/conversation-assistant/ml-service/src/suggested_replies.py b/features/conversation-assistant/ml-service/src/suggested_replies.py index aeff6b012..14e1a8bcd 100644 --- a/features/conversation-assistant/ml-service/src/suggested_replies.py +++ b/features/conversation-assistant/ml-service/src/suggested_replies.py @@ -14,7 +14,7 @@ from datetime import datetime, timedelta from pydantic import BaseModel, Field -from tqftw_ml_service_base import get_logger +from tqftw_fastapi_service_base import get_logger from .config import settings from .redis_client import redis_client diff --git a/features/conversation-assistant/ml-service/src/trainer.py b/features/conversation-assistant/ml-service/src/trainer.py index 65002203d..5487cf107 100644 --- a/features/conversation-assistant/ml-service/src/trainer.py +++ b/features/conversation-assistant/ml-service/src/trainer.py @@ -10,7 +10,7 @@ from pathlib import Path from typing import Any, Callable, Optional import json -from tqftw_ml_service_base import get_logger +from tqftw_fastapi_service_base import get_logger logger = get_logger(__name__)