V1/development ai ml#4
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
docker-compose.ymlfile to orchestrate the Ollama model server and a FastAPI-based gateway, exposing ports and configuring volumes and dependencies.README.mdwith setup instructions, project structure, and usage guidance for the new AI engine stack.Dockerfilefor the gateway service, installing dependencies and launching the FastAPI app with Uvicorn.pyproject.tomlandrequirements.txtfor dependency and build management, including FastAPI, HTTPX, and testing tools. [1] [2].env.examplefile to document required environment variables for configuration.Gateway application logic:
src/main.py, including endpoints for health checks, model listing, and chat requests, with dependency injection, error handling, and upstream communication to Ollama.src/config.pyusing Pydantic settings, supporting environment-based overrides.src/dependencies.py.src/models.py.src/utils/image.pyfor handling image sources and media types (not yet integrated into endpoints).Testing and quality:
tests/conftest.py.tests/test_gateway.pywith 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.