Python LLM Core Framework
Relevant source files
The following files were used as context for generating this wiki page:
The Python LLM Core Framework is a production-ready architectural layer within the Everything Claude Code (ECC) project designed to manage Large Language Model (LLM) interactions, provider resolutions, and tool executions. It serves as the backbone for specialized agents and multi-model workflows, ensuring that backend logic, algorithms, and technical feasibility assessments are handled by high-authority models like Codex.
This framework facilitates a structured 6-phase development workflow (Research, Ideation, Plan, Execute, Optimize, Review), integrating external models such as Gemini for frontend perspectives while maintaining Claude as the central orchestrator. It enforces strict security guidelines, including input validation and secret management, to protect the integrity of the automated coding environment.
Sources: AGENTS.md:1-15, commands/multi-backend.md:18-25, commands/multi-plan.md:10-20
Core Architectural Components
The framework is organized into three primary layers: Core Interfaces, Provider Resolvers, and Tool Executors. These components work together to ensure model-agnostic operations and secure tool invocation.
LLM Interface and Abstraction
The core interface defines the standard protocol for interacting with different LLMs. It ensures that regardless of the backend provider (e.g., Codex or Gemini), the system can communicate using a unified set of methods for prompt enhancement, context retrieval, and response handling.
Sources: src/llm/core/interface.py, commands/multi-plan.md:100-115
Provider Resolver
The Resolver is responsible for dynamic model selection and session management. It routes backend-focused tasks to authority models like Codex and frontend UI/UX tasks to Gemini. It also handles session persistence, allowing subsequent workflow phases to "resume" previous model states via a SESSION_ID.
| Component | Responsibility | Primary Model |
|---|---|---|
| Backend Orchestrator | Technical feasibility, algorithms, backend logic | Codex |
| Frontend Orchestrator | UI/UX, responsive layouts, animations | Gemini |
| Orchestrator (Claude) | Planning, tool execution, delivery | Claude |
Sources: src/llm/providers/resolver.py, commands/multi-backend.md:18-25, commands/multi-frontend.md:18-25
Multi-Model Workflow Logic
The framework utilizes a sequence-based execution flow. The following diagram illustrates how the system transitions between modes during a backend task.
This flow diagram shows the progression through the six standard development phases, highlighting the points where Codex is invoked for backend authority.
Sources: commands/multi-backend.md:46-52, commands/multi-workflow.md:73-80
Specialized Agent Orchestration
The framework supports 67 specialized agents that operate under specific domain constraints. These agents are categorized by their purpose, ranging from implementation planning to security reviews.
Agent Categories and Tools
Agents use standardized tools for repository interaction, such as Read, Write, Grep, and Bash. The python-reviewer agent, for example, is a specialized component within this framework focused on PEP 8 compliance, type hints, and security vulnerability detection in Python code.
The class diagram represents the relationship between the base agent configuration and specialized implementations like the Python Reviewer and Planner.
Execution Constraints
To maintain system safety, the framework enforces "Code Sovereignty." External models (Codex, Gemini) have zero filesystem write access. All modifications to production code are handled exclusively by the Claude orchestrator based on the plans generated during the collaborative phases.
Sources: commands/multi-plan.md:13-20, commands/multi-workflow.md:138-145
Security and Quality Gates
The Python LLM Core Framework integrates rigorous validation steps at every boundary.
Review Priorities for Python Code
The python-reviewer follows a strict hierarchy of checks to ensure code quality before deployment.
| Severity | Category | Specific Checks |
|---|---|---|
| CRITICAL | Security | SQL Injection, Command Injection, Path Traversal |
| CRITICAL | Error Handling | Bare except blocks, Swallowed exceptions |
| HIGH | Type Hints | Public function annotations, Optional types |
| HIGH | Pythonic Patterns | List comprehensions, isinstance vs type |
Sources: agents/python-reviewer.md:22-65
Diagnostic Commands
The framework leverages standard Python tooling to enforce these quality gates:
# Example diagnostic suite execution
mypy . # Type checking
ruff check . # Fast linting
bandit -r . # Security scan
pytest --cov=app --cov-report=term-missing # Test coverage
Sources: agents/python-reviewer.md:80-86
Conclusion
The Python LLM Core Framework provides a robust, multi-layered architecture for AI-driven development. By leveraging specialized agents and high-authority models like Codex for backend tasks, it ensures technical accuracy while maintaining strict security through Claude-led orchestration. The integration of 6-phase workflows and automated diagnostic tools establishes a standardized environment for generating maintainable and secure Python codebases.
Sources: AGENTS.md:235-245, commands/multi-workflow.md:14-20