How davidlms/aphra works
Main Components
a. Core Components:
• Input/Output Interface (CLI and Python API)
• Configuration Manager (handling config.toml)
• LLM Client (llm_client.py)
• Translation Orchestrator (translate.py)
• Prompt Manager (prompts.py and prompts directory)
• Parser System (parsers.py)
b. External Components:
• OpenRouter API
• LLM Models (Writer, Searcher, Critic)
Component Relationships
Top Layer:
• Interface Layer: Show both CLI (aphra_runner.py) and Python API entry points
• Configuration Layer: Display config.toml integration
Middle Layer:
• Core Processing Layer: Show the main translation orchestrator
• LLM Client Layer: Demonstrate API communication
• Prompt Management Layer: Show prompt template system
Bottom Layer:
• External Services Layer: Display OpenRouter and LLM models
Specific Elements
• Input handlers for both file-based and direct text input
• Configuration flow showing how API keys and model settings are managed
• Clear separation between the different LLM roles (Writer, Searcher, Critic)
• Parallel processing paths for search and initial translation
• Error handling and feedback loops
• Output formatting and file writing capabilities