build and extend django rest framework features for llm-based applications with multi-provider support configured from django admin. use when the user wants to add a new api endpoint, service, serializer, admin configuration, provider routing logic, conversation flow, usage logging, or a reusable backend pattern for an ai/chat application built with django and drf.
Implement new backend features for a Django + DRF application that integrates with one or more LLM providers configured from Django admin.
Work as a senior Django backend engineer. Favor clean architecture, reusable service layers, explicit validation, and admin-driven configuration.
When asked to add a feature:
Identify the feature boundary first:
Default to this architecture unless the user specifies otherwise:
models.py for persistent configuration and logsadmin.py for provider/model configurationserializers.py for request/response validationviews.py or viewsets.py for HTTP layerservices/ for llm orchestration and provider routingselectors/ for read-only query logic when usefultasks.py for async workurls.py for endpoint registrationSeparate provider-specific logic from application logic.
For multi-provider systems, prefer these entities:
LLMProviderLLMModelConfigPromptTemplateConversationMessageLLMRequestLogAlways include:
For implementation requests, produce output in this order:
When building multi-provider support:
When admin-managed configuration is involved:
Read these when relevant:
references/architecture.md for suggested layeringreferences/conventions.md for naming and error-handling conventionsUse scripts/scaffold_checklist.py if you need to generate or verify a feature implementation checklist before writing code.39:["$","$L41",null,{"content":"$42","frontMatter":{"name":"django-llm-feature-builder","description":"build and extend django rest framework features for llm-based applications with multi-provider support configured from django admin. use when the user wants to add a new api endpoint, service, serializer, admin configuration, provider routing logic, conversation flow, usage logging, or a reusable backend pattern for an ai/chat application built with django and drf."}}]