feat(chat): scaffold chatbotAPI with local Ollama integration#30
Open
Yatharth-coding wants to merge 2 commits into
Open
feat(chat): scaffold chatbotAPI with local Ollama integration#30Yatharth-coding wants to merge 2 commits into
Yatharth-coding wants to merge 2 commits into
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.
Executive Summary
This PR introduces the foundational backend architecture for the AI Circuit Assistant (Minor Project). It scaffolds the new
chatbotAPIDjango app and integrates a secure, fully local LLM client using Ollama. This ensures the AI assistant can run entirely locally without relying on paid external APIs, API keys, or internet connectivity.Key Features & Implementations
chatbotAPIScaffold: Created the core Django app structure following the project's existing API conventions, including URL routing and app registration.services/llm_client.pyto handle HTTP communication with a local Ollama instance.GET /api/chat/health/: Added an open health check endpoint.POST /api/chat/message/: Implemented the main chat interface featuring strict payload validation (enforcing an 8KB limit on context JSON to prevent oversized requests).unittest.mockto ensure that CI/CD pipelines will pass without requiring a live Ollama server to be running.Local Testing Instructions for Reviewers
ollama pull llama3.2(or the model specified in your.env).11434./api/chat/message/endpoint.