🔧 Update conversation-assistant ML service dependencies

- Dockerfile: Update to tqftw-fastapi-service-base package
- pyproject.toml: Bump dependencies and fix package names
- Update all imports from tqftw_ml_service_base → tqftw_fastapi_service_base
- Update env example and docs with correct package name

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lilith 2026-01-02 22:01:50 -08:00
parent 7e561c4d25
commit bce0d0116f
18 changed files with 26 additions and 36 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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 = [

View file

@ -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

View file

@ -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):

View file

@ -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

View file

@ -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 (

View file

@ -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__)

View file

@ -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

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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__)

View file

@ -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

View file

@ -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__)