Version 1.4.0

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-05 01:48:23 +00:00
parent dc7a459ebb
commit 6947819742
4 changed files with 551 additions and 85 deletions

View File

@@ -1,14 +1,15 @@
# IGNY8 Change Log
**Current Version:** 1.3.2
**Last Updated:** January 3, 2026
**Current Version:** 1.4.0
**Last Updated:** January 5, 2026
---
Restored
## Version History
| Version | Date | Summary |
|---------|------|---------|
| 1.4.0 | Jan 5, 2026 | **Major** - AI Model Architecture Overhaul, IntegrationProvider Model, AIModelConfig with Credit System, SystemAISettings, Django Admin Reorganization |
| 1.3.2 | Jan 3, 2026 | **Major** - Publishing Scheduler, Onboarding Wizard, Content Calendar, Design System Consolidation, Site Dashboard redesign |
| 1.3.1 | Jan 2, 2026 | **Design System Consolidation** - Updated .rules with comprehensive design system & component rules, ESLint enforcement |
| 1.3.0 | Jan 1, 2026 | **Major** - Automation overhaul, AI provider integrations (Anthropic/Bria), Model Registry, Global Progress tracking, CSS globalization |
@@ -34,6 +35,174 @@ Restored
---
## v1.4.0 - January 5, 2026
### Major Release: AI Architecture Overhaul & Model Configuration System
This release introduces a comprehensive refactoring of the AI system architecture, centralizing all AI model configurations, provider API keys, and credit-based billing into a unified, database-driven system. Key improvements include the new `IntegrationProvider`, `AIModelConfig`, and `SystemAISettings` models, along with Django Admin reorganization and enhanced frontend settings pages.
---
### 🤖 AI Model Architecture Overhaul (MAJOR)
**New Model: IntegrationProvider** (`modules/system/models.py`)
- Centralized storage for ALL external service API keys
- Supports providers: `openai`, `anthropic`, `runware`, `stripe`, `paypal`, `resend`
- Fields: `provider_id` (PK), `display_name`, `provider_type` (ai/payment/email/storage)
- API key management: `api_key`, `api_secret`, `webhook_secret`, `api_endpoint`
- Configuration: `config` (JSONField), `is_active`, `is_sandbox`
- Audit trail: `updated_by`, `created_at`, `updated_at`
**New Model: AIModelConfig** (`business/billing/models.py`)
- Single Source of Truth for all AI models (text + image) with pricing
- Fields: `model_name` (unique), `model_type` (text/image), `provider`, `display_name`
- Status: `is_default` (one per type), `is_active`
- Text Model Pricing: `cost_per_1k_input`, `cost_per_1k_output`, `tokens_per_credit`
- Image Model Pricing: `credits_per_image`, `quality_tier` (basic/quality/premium)
- Model Limits: `max_tokens`, `context_window`, `capabilities` (JSONField)
- History tracking via `simple_history`
**New Model: SystemAISettings** (`modules/system/ai_settings.py`)
- System-wide AI defaults (Singleton pattern, pk=1)
- AI Parameters: `temperature` (0.0-2.0), `max_tokens`
- Image Settings: `image_style`, `image_quality`, `max_images_per_article`, `image_size`
- Helper methods: `get_effective_*` for account-specific overrides via `AccountSettings`
- Image Style Choices: photorealistic, illustration, 3d_render, minimal_flat, artistic, cartoon
**Model Registry Service** (`ai/model_registry.py`)
- Central registry with database-driven model configuration
- Caching layer for performance (5-minute TTL)
- Methods: `get_model()`, `get_rate()`, `calculate_cost()`, `get_default_model()`
- Provider methods: `get_provider()`, `get_api_key()`, `get_api_secret()`, `get_webhook_secret()`
- List and validation: `list_models()`, `validate_model()`, `clear_cache()`
---
### 💰 Credit System Integration
**AIModelConfig Credit Fields:**
- `tokens_per_credit` - Text models: tokens per 1 credit (e.g., 1000 for GPT-4, 10000 for GPT-4o-mini)
- `credits_per_image` - Image models: credits per image (1=basic, 5=quality, 15=premium)
- `quality_tier` - Image quality tier for UI display
**Credit Cost Configuration:**
- Per `final-model-schemas.md`: Simplified to `operation_type`, `display_name`, `base_credits`, `is_active`
- Removed `tokens_per_credit` from CreditCostConfig (moved to AIModelConfig)
**New Migrations:**
- `0025_add_aimodel_credit_fields.py` - Add credit fields to AIModelConfig
- `0026_populate_aimodel_credits.py` - Populate default credit values
- `0027_model_schema_update.py` - Schema updates for final model architecture
---
### 🔧 Django Admin Reorganization
**Admin Group Structure:**
- Consolidated admin panels with logical grouping
- AI Configuration: AIModelConfig, IntegrationProvider, SystemAISettings
- Billing: CreditCostConfig, BillingConfiguration, Invoices, Payments, Credit Packages
- Custom logo support via `staticfiles/admin/img/`
**AIModelConfig Admin:**
- List display: model_name, model_type, provider, is_default, is_active
- Bulk actions: activate/deactivate, set as default
- Fieldsets: Basic Info, Pricing (Text), Pricing (Image), Model Limits, Capabilities
- Import/Export support
**IntegrationProvider Admin:**
- List display: provider_id, display_name, provider_type, is_active, is_sandbox
- Secure API key display (masked in list view)
- Fieldsets: Provider Info, Authentication, Configuration, Status
---
### 🎨 Frontend Settings Updates
**Site Settings Page Refactoring** (`pages/Sites/Settings.tsx`)
- Tab restructure: General → AI Settings → Integrations → Publishing → Content Types
- Image settings merged into AI Settings tab (previously separate)
- Quality tier picker with credit display
- Temperature and max_tokens controls
- Image style selection with previews
**AI Settings Tab Features:**
- Content Generation Settings: append_to_prompt, default_tone, default_length
- AI Parameters: temperature slider (0.0-2.0), max_tokens dropdown
- Image Generation: quality tier selector (Basic/Quality/Premium with credit costs)
- Image style dropdown with 6 style options
- Max images per article control (1-8)
**Removed Pages:**
- `frontend/src/pages/Settings/AI.tsx` - Merged into Site Settings AI tab
---
### 📊 System Migrations
**System Module Migrations:**
- `0015_add_integration_provider.py` - Create IntegrationProvider model
- `0016_populate_integration_providers.py` - Seed default providers (openai, runware, anthropic, stripe, paypal, resend)
- `0017_create_ai_settings.py` - Create AISettings model
- `0018_create_ai_settings_table.py` - Create SystemAISettings table
- `0019_model_schema_update.py` - Final schema updates
**Billing Module Migrations:**
- `0024_update_image_models_v2.py` - Update image model configurations
- `0025_add_aimodel_credit_fields.py` - Add credit fields
- `0026_populate_aimodel_credits.py` - Populate credit values
- `0027_model_schema_update.py` - Schema finalization
---
### 🔄 AI Core Updates
**AI Core Service** (`ai/ai_core.py`)
- Refactored to use ModelRegistry for model configuration
- Dynamic API key retrieval from IntegrationProvider
- Improved error handling and logging
- Cost calculation using AIModelConfig rates
**AI Tasks** (`ai/tasks.py`)
- Updated to use new model configuration system
- Credit deduction via AIModelConfig settings
- Quality tier support for image generation
**AI Settings** (`ai/settings.py`)
- Simplified to use SystemAISettings singleton
- Removed hardcoded API keys (now in IntegrationProvider)
- Helper functions for getting effective settings with account overrides
**Generate Images** (`ai/functions/generate_images.py`)
- Quality tier-based model selection
- Credits deducted based on `credits_per_image` from AIModelConfig
- Style parameter support from SystemAISettings
---
### 📝 Documentation Updates
**New Documentation:**
- `docs/plans/4th-jan-refactor/final-model-schemas.md` - Complete model schema specification
- `docs/plans/4th-jan-refactor/django-plan.md` - Django admin reorganization plan
**Model Architecture:**
- Total Models: 5 (IntegrationProvider, AIModelConfig, AISettings, AccountSettings, CreditCostConfig)
- Removed: IntegrationSettings merged into AISettings/AccountSettings
- Simplified: CreditCostConfig.tokens_per_credit moved to AIModelConfig
---
### 🐛 Bug Fixes & Improvements
- Fixed image generation model selection for different quality tiers
- Improved API key security (no longer stored in GlobalIntegrationSettings)
- Fixed admin panel navigation for billing and AI configuration
- Corrected credit calculation for token-based text models
- Fixed singleton pattern enforcement for SystemAISettings
---
## v1.3.2 - January 3, 2026
### Major Release: Publishing Scheduler, Onboarding Wizard & Content Calendar