Skip to content

V1/development ai ml#4

Merged
Aytsuu merged 2 commits into
v1/developmentfrom
v1/development-ai-ml
May 21, 2026
Merged

V1/development ai ml#4
Aytsuu merged 2 commits into
v1/developmentfrom
v1/development-ai-ml

Conversation

@Aytsuu

@Aytsuu Aytsuu commented May 21, 2026

Copy link
Copy Markdown
Owner

This pull request introduces a new "LoopHarvest AI Engine" stack, providing a local AI API gateway using FastAPI and Ollama, containerized with Docker Compose. The implementation includes a secure gateway service, configuration and environment management, model and error schemas, utilities, and a comprehensive test suite.

Core service and infrastructure:

  • Added a docker-compose.yml file to orchestrate the Ollama model server and a FastAPI-based gateway, exposing ports and configuring volumes and dependencies.
  • Introduced a README.md with setup instructions, project structure, and usage guidance for the new AI engine stack.
  • Created a Dockerfile for the gateway service, installing dependencies and launching the FastAPI app with Uvicorn.
  • Added pyproject.toml and requirements.txt for dependency and build management, including FastAPI, HTTPX, and testing tools. [1] [2]
  • Provided an .env.example file to document required environment variables for configuration.

Gateway application logic:

  • Implemented the FastAPI gateway in src/main.py, including endpoints for health checks, model listing, and chat requests, with dependency injection, error handling, and upstream communication to Ollama.
  • Added configuration management via src/config.py using Pydantic settings, supporting environment-based overrides.
  • Enforced API key authentication with dependency logic in src/dependencies.py.
  • Defined Pydantic models for chat requests, responses, and error envelopes in src/models.py.
  • Added a utility in src/utils/image.py for handling image sources and media types (not yet integrated into endpoints).

Testing and quality:

  • Added fixtures and configuration for pytest-based testing in tests/conftest.py.
  • Implemented a test suite in tests/test_gateway.py with mock upstreams to verify endpoints, authentication, error handling, and chat functionality.

These changes together establish a robust, testable, and extensible local AI API stack for LoopHarvest.

Copilot AI review requested due to automatic review settings May 21, 2026 19:37
@Aytsuu
Aytsuu merged commit de2c7f1 into v1/development May 21, 2026
1 check passed
@Aytsuu
Aytsuu deleted the v1/development-ai-ml branch May 21, 2026 19:39
@Aytsuu
Aytsuu removed the request for review from Copilot May 21, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant