Skip to content

Commit e35334a

Browse files
committed
docs: update codeboarding documentation in advanced-customization
## 📚 Documentation Update This commit contains updated documentation files fetched from the CodeBoarding service and copied to the advanced-customization section. ### 📊 Summary - Documentation files created/updated: 8 - JSON files created/updated: 9 - Documentation directory: .codeboarding/ - JSON directory: .codeboarding/ - Output format: .md - Repository analyzed: https://github.com/Pipelex/pipelex - Destination: docs/pages/advanced-customization/ The generated .md files have been automatically copied to the advanced-customization documentation section. 🤖 This commit was automatically generated by the CodeBoarding documentation update workflow.
1 parent 60b9b7f commit e35334a

35 files changed

+2303
-1870
lines changed
Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
{
2+
"description": "The core of the `pipelex` AI subsystem revolves around the `InferenceManager`, which acts as a central orchestrator for various AI tasks. It dynamically manages and delegates requests to specialized worker components like `LLMWorkerAbstract` for language models, `ImggEngine` for image generation, and `OCRWorkerAbstract` for optical character recognition. The `PluginManager` plays a crucial role in extending the system's capabilities by providing concrete implementations of these abstract workers to the `InferenceManager`. Higher-level components like `ContentGenerator` leverage the `InferenceManager` to compose complex AI workflows, demonstrating a clear separation of concerns and promoting extensibility through its plugin-based architecture. This design allows for flexible integration of diverse AI models and services, making the system adaptable to evolving AI landscapes.",
3+
"components": [
4+
{
5+
"name": "InferenceManager",
6+
"description": "Acts as the central orchestrator and facade for all AI inference tasks. It provides a unified entry point for AI requests and intelligently routes them to the appropriate specialized AI worker or engine based on the task type (LLM, image generation, OCR). This component is fundamental for abstracting the underlying AI services and centralizing inference control, aligning with the \"Workflow Orchestrator/Engine\" pattern.",
7+
"referenced_source_code": [
8+
{
9+
"qualified_name": "pipelex.cogt.inference.inference_manager.InferenceManager",
10+
"reference_file": "pipelex/cogt/inference/inference_manager.py",
11+
"reference_start_line": 21,
12+
"reference_end_line": 159
13+
}
14+
],
15+
"assigned_files": [
16+
"pipelex/cogt/inference/__init__.py",
17+
"pipelex/cogt/inference/inference_job_abstract.py",
18+
"pipelex/cogt/inference/inference_manager_protocol.py",
19+
"pipelex/cogt/inference/inference_manager.py",
20+
"pipelex/cogt/inference/inference_worker_abstract.py",
21+
"pipelex/cogt/model_routing/routing_models.py",
22+
"pipelex/cogt/model_routing/__init__.py",
23+
"pipelex/cogt/model_routing/routing_profile_factory.py",
24+
"pipelex/cogt/model_routing/routing_profile_library.py",
25+
"pipelex/cogt/model_routing/routing_profile.py",
26+
"pipelex/cogt/models/__init__.py",
27+
"pipelex/cogt/models/model_manager_abstract.py",
28+
"pipelex/cogt/models/model_manager.py",
29+
"pipelex/cogt/models/model_deck_check.py",
30+
"pipelex/cogt/models/model_deck.py"
31+
],
32+
"can_expand": true
33+
},
34+
{
35+
"name": "LLMWorkerAbstract",
36+
"description": "An abstract base class that defines the standardized interface for interacting with Large Language Models. It embodies the 'LLM Adapters/Providers' pattern, ensuring that different LLM backends can be seamlessly integrated and interchanged. This abstraction is critical for maintaining modularity and extensibility within the AI service layer.",
37+
"referenced_source_code": [
38+
{
39+
"qualified_name": "pipelex.cogt.llm.llm_worker_abstract.LLMWorkerAbstract",
40+
"reference_file": "pipelex/cogt/llm/llm_worker_abstract.py",
41+
"reference_start_line": 14,
42+
"reference_end_line": 121
43+
}
44+
],
45+
"assigned_files": [
46+
"pipelex/cogt/llm/llm_job.py",
47+
"pipelex/cogt/llm/llm_job_components.py",
48+
"pipelex/cogt/llm/llm_prompt_template.py",
49+
"pipelex/cogt/llm/__init__.py",
50+
"pipelex/cogt/llm/llm_worker_abstract.py",
51+
"pipelex/cogt/llm/llm_setting.py",
52+
"pipelex/cogt/llm/llm_worker_factory.py",
53+
"pipelex/cogt/llm/llm_prompt_spec.py",
54+
"pipelex/cogt/llm/llm_worker_internal_abstract.py",
55+
"pipelex/cogt/llm/llm_job_factory.py",
56+
"pipelex/cogt/llm/llm_prompt_factory_abstract.py",
57+
"pipelex/cogt/llm/llm_report.py",
58+
"pipelex/cogt/llm/llm_prompt.py",
59+
"pipelex/cogt/llm/structured_output.py",
60+
"pipelex/cogt/llm/llm_prompt_template_inputs.py",
61+
"pipelex/plugins/mistral/mistral_llms.py",
62+
"pipelex/plugins/mistral/mistral_llm_worker.py"
63+
],
64+
"can_expand": true
65+
},
66+
{
67+
"name": "ImggEngine",
68+
"description": "A concrete component responsible for handling image generation requests. It encapsulates the specific logic and API calls required to interact with image generation services. This component represents a specific 'Tool/Service Integration' within the AI abstraction, demonstrating how diverse AI capabilities are integrated.",
69+
"referenced_source_code": [
70+
{
71+
"qualified_name": "pipelex.cogt.imgg.imgg_engine.ImggEngine",
72+
"reference_file": "pipelex/cogt/imgg/imgg_engine.py",
73+
"reference_start_line": 6,
74+
"reference_end_line": 12
75+
}
76+
],
77+
"assigned_files": [
78+
"pipelex/cogt/imgg/__init__.py",
79+
"pipelex/cogt/imgg/imgg_job_components.py",
80+
"pipelex/cogt/imgg/imgg_engine_factory.py",
81+
"pipelex/cogt/imgg/imgg_prompt.py",
82+
"pipelex/cogt/imgg/imgg_handle.py",
83+
"pipelex/cogt/imgg/imgg_job.py",
84+
"pipelex/cogt/imgg/imgg_engine.py",
85+
"pipelex/cogt/imgg/imgg_platform.py",
86+
"pipelex/cogt/imgg/imgg_job_factory.py",
87+
"pipelex/cogt/imgg/imgg_worker_factory.py",
88+
"pipelex/cogt/imgg/imgg_worker_abstract.py",
89+
"pipelex/cogt/image/prompt_image.py",
90+
"pipelex/cogt/image/__init__.py",
91+
"pipelex/cogt/image/prompt_image_factory.py",
92+
"pipelex/cogt/image/generated_image.py",
93+
"pipelex/plugins/fal/fal_imgg_worker.py"
94+
],
95+
"can_expand": false
96+
},
97+
{
98+
"name": "OCRWorkerAbstract",
99+
"description": "An abstract base class for Optical Character Recognition services, providing a unified interface for different OCR providers. Similar to `LLMWorkerAbstract`, it defines the contract for OCR services, allowing for interchangeable OCR backends and supporting the \"Tool/Service Integrations\" pattern.",
100+
"referenced_source_code": [
101+
{
102+
"qualified_name": "pipelex.cogt.ocr.ocr_worker_abstract.OcrWorkerAbstract",
103+
"reference_file": "pipelex/cogt/ocr/ocr_worker_abstract.py",
104+
"reference_start_line": 15,
105+
"reference_end_line": 73
106+
}
107+
],
108+
"assigned_files": [
109+
"pipelex/cogt/ocr/__init__.py",
110+
"pipelex/cogt/ocr/ocr_job_components.py",
111+
"pipelex/cogt/ocr/ocr_input.py",
112+
"pipelex/cogt/ocr/ocr_job.py",
113+
"pipelex/cogt/ocr/ocr_job_factory.py",
114+
"pipelex/cogt/ocr/ocr_output.py",
115+
"pipelex/cogt/ocr/ocr_worker_factory.py",
116+
"pipelex/plugins/pypdfium2/pypdfium2_worker.py",
117+
"pipelex/plugins/mistral/mistral_ocr_worker.py"
118+
],
119+
"can_expand": true
120+
},
121+
{
122+
"name": "ContentGenerator",
123+
"description": "This component orchestrates multiple AI services (primarily LLMs) to generate more complex content. It acts as a higher-level consumer of the AI abstraction layer, composing and orchestrating calls to various AI services to produce structured or creative content. It represents a key aspect of the \"Pipe Executors/Runners\" by defining how AI tasks are combined into meaningful workflows.",
124+
"referenced_source_code": [
125+
{
126+
"qualified_name": "pipelex.cogt.content_generation.content_generator.ContentGenerator",
127+
"reference_file": "pipelex/cogt/content_generation/content_generator.py",
128+
"reference_start_line": 38,
129+
"reference_end_line": 280
130+
}
131+
],
132+
"assigned_files": [
133+
"pipelex/cogt/content_generation/__init__.py",
134+
"pipelex/cogt/content_generation/content_generator_dry.py",
135+
"pipelex/cogt/content_generation/assignment_models.py",
136+
"pipelex/cogt/content_generation/jinja2_generate.py",
137+
"pipelex/cogt/content_generation/llm_generate.py",
138+
"pipelex/cogt/content_generation/content_generator_protocol.py",
139+
"pipelex/cogt/content_generation/ocr_generate.py",
140+
"pipelex/cogt/content_generation/imgg_generate.py",
141+
"pipelex/cogt/content_generation/content_generator.py"
142+
],
143+
"can_expand": true
144+
},
145+
{
146+
"name": "PluginManager",
147+
"description": "Essential for the 'Extensibility/Plugin-based Architecture,' this component manages the discovery, loading, and provision of concrete AI service implementations (e.g., specific LLM or OCR providers). It facilitates the dynamic extension of AI service capabilities, which is crucial for an AI Workflow Orchestration Library to support new and evolving AI models and services.",
148+
"referenced_source_code": [
149+
{
150+
"qualified_name": "pipelex.plugins.plugin_manager.PluginManager",
151+
"reference_file": "pipelex/plugins/plugin_manager.py",
152+
"reference_start_line": 4,
153+
"reference_end_line": 12
154+
}
155+
],
156+
"assigned_files": [
157+
"pipelex/plugins/__init__.py",
158+
"pipelex/plugins/plugin_sdk_registry.py",
159+
"pipelex/plugins/plugin_manager.py",
160+
"pipelex/plugins/openai/openai_imgg_factory.py",
161+
"pipelex/plugins/openai/__init__.py",
162+
"pipelex/plugins/openai/openai_llm_worker.py",
163+
"pipelex/plugins/openai/openai_llms.py",
164+
"pipelex/plugins/openai/openai_factory.py",
165+
"pipelex/plugins/openai/openai_func.py",
166+
"pipelex/plugins/openai/vertexai_factory.py",
167+
"pipelex/plugins/openai/openai_imgg_worker.py",
168+
"pipelex/plugins/bedrock/__init__.py",
169+
"pipelex/plugins/bedrock/bedrock_client_protocol.py",
170+
"pipelex/plugins/bedrock/bedrock_factory.py",
171+
"pipelex/plugins/bedrock/bedrock_message.py",
172+
"pipelex/plugins/bedrock/bedrock_llm_worker.py",
173+
"pipelex/plugins/bedrock/bedrock_client_aioboto3.py",
174+
"pipelex/plugins/bedrock/bedrock_client_boto3.py",
175+
"pipelex/plugins/anthropic/__init__.py",
176+
"pipelex/plugins/anthropic/anthropic_exceptions.py",
177+
"pipelex/plugins/anthropic/anthropic_llm_worker.py",
178+
"pipelex/plugins/anthropic/anthropic_factory.py",
179+
"pipelex/plugins/anthropic/anthropic_llms.py",
180+
"pipelex/cogt/model_backends/backend.py",
181+
"pipelex/cogt/model_backends/backend_factory.py",
182+
"pipelex/cogt/model_backends/__init__.py",
183+
"pipelex/cogt/model_backends/model_constraints.py",
184+
"pipelex/cogt/model_backends/model_spec_factory.py",
185+
"pipelex/cogt/model_backends/prompting_target.py",
186+
"pipelex/cogt/model_backends/backend_library.py",
187+
"pipelex/cogt/model_backends/model_spec.py",
188+
"pipelex/cogt/model_backends/model_type.py",
189+
"pipelex/plugins/fal/__init__.py",
190+
"pipelex/plugins/fal/fal_config.py",
191+
"pipelex/plugins/fal/fal_factory.py",
192+
"pipelex/plugins/mistral/__init__.py",
193+
"pipelex/plugins/mistral/mistral_utils.py",
194+
"pipelex/plugins/mistral/mistral_factory.py",
195+
"pipelex/plugins/mistral/mistral_exceptions.py"
196+
],
197+
"can_expand": false
198+
},
199+
{
200+
"name": "Unclassified",
201+
"description": "Component for all unclassified files and utility functions (Utility functions/External Libraries/Dependencies)",
202+
"referenced_source_code": [],
203+
"assigned_files": [
204+
"pipelex/cogt/__init__.py",
205+
"pipelex/cogt/config_cogt.py",
206+
"pipelex/cogt/exceptions.py",
207+
"pipelex/cogt/usage/costs_per_token.py",
208+
"pipelex/cogt/usage/cost_registry.py",
209+
"pipelex/cogt/usage/token_category.py",
210+
"pipelex/cogt/usage/cost_category.py"
211+
],
212+
"can_expand": false
213+
}
214+
],
215+
"components_relations": [
216+
{
217+
"relation": "delegates tasks to",
218+
"src_name": "InferenceManager",
219+
"dst_name": "LLMWorkerAbstract"
220+
},
221+
{
222+
"relation": "delegates tasks to",
223+
"src_name": "InferenceManager",
224+
"dst_name": "ImggEngine"
225+
},
226+
{
227+
"relation": "delegates tasks to",
228+
"src_name": "InferenceManager",
229+
"dst_name": "OCRWorkerAbstract"
230+
},
231+
{
232+
"relation": "queries",
233+
"src_name": "InferenceManager",
234+
"dst_name": "PluginManager"
235+
},
236+
{
237+
"relation": "uses",
238+
"src_name": "ContentGenerator",
239+
"dst_name": "InferenceManager"
240+
},
241+
{
242+
"relation": "provides implementations to",
243+
"src_name": "PluginManager",
244+
"dst_name": "InferenceManager"
245+
}
246+
]
247+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
```mermaid
2+
graph LR
3+
InferenceManager["InferenceManager"]
4+
LLMWorkerAbstract["LLMWorkerAbstract"]
5+
ImggEngine["ImggEngine"]
6+
OCRWorkerAbstract["OCRWorkerAbstract"]
7+
ContentGenerator["ContentGenerator"]
8+
PluginManager["PluginManager"]
9+
Unclassified["Unclassified"]
10+
InferenceManager -- "delegates tasks to" --> LLMWorkerAbstract
11+
InferenceManager -- "delegates tasks to" --> ImggEngine
12+
InferenceManager -- "delegates tasks to" --> OCRWorkerAbstract
13+
InferenceManager -- "queries" --> PluginManager
14+
ContentGenerator -- "uses" --> InferenceManager
15+
PluginManager -- "provides implementations to" --> InferenceManager
16+
```
17+
18+
[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/CodeBoarding)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/diagrams)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org)
19+
20+
## Details
21+
22+
The core of the `pipelex` AI subsystem revolves around the `InferenceManager`, which acts as a central orchestrator for various AI tasks. It dynamically manages and delegates requests to specialized worker components like `LLMWorkerAbstract` for language models, `ImggEngine` for image generation, and `OCRWorkerAbstract` for optical character recognition. The `PluginManager` plays a crucial role in extending the system's capabilities by providing concrete implementations of these abstract workers to the `InferenceManager`. Higher-level components like `ContentGenerator` leverage the `InferenceManager` to compose complex AI workflows, demonstrating a clear separation of concerns and promoting extensibility through its plugin-based architecture. This design allows for flexible integration of diverse AI models and services, making the system adaptable to evolving AI landscapes.
23+
24+
### InferenceManager
25+
Acts as the central orchestrator and facade for all AI inference tasks. It provides a unified entry point for AI requests and intelligently routes them to the appropriate specialized AI worker or engine based on the task type (LLM, image generation, OCR). This component is fundamental for abstracting the underlying AI services and centralizing inference control, aligning with the "Workflow Orchestrator/Engine" pattern.
26+
27+
28+
**Related Classes/Methods**:
29+
30+
- <a href="https://github.com/Pipelex/pipelex/blob/mainpipelex/cogt/inference/inference_manager.py#L21-L159" target="_blank" rel="noopener noreferrer">`pipelex.cogt.inference.inference_manager.InferenceManager`:21-159</a>
31+
32+
33+
### LLMWorkerAbstract
34+
An abstract base class that defines the standardized interface for interacting with Large Language Models. It embodies the 'LLM Adapters/Providers' pattern, ensuring that different LLM backends can be seamlessly integrated and interchanged. This abstraction is critical for maintaining modularity and extensibility within the AI service layer.
35+
36+
37+
**Related Classes/Methods**:
38+
39+
- <a href="https://github.com/Pipelex/pipelex/blob/mainpipelex/cogt/llm/llm_worker_abstract.py#L14-L121" target="_blank" rel="noopener noreferrer">`pipelex.cogt.llm.llm_worker_abstract.LLMWorkerAbstract`:14-121</a>
40+
41+
42+
### ImggEngine
43+
A concrete component responsible for handling image generation requests. It encapsulates the specific logic and API calls required to interact with image generation services. This component represents a specific 'Tool/Service Integration' within the AI abstraction, demonstrating how diverse AI capabilities are integrated.
44+
45+
46+
**Related Classes/Methods**:
47+
48+
- <a href="https://github.com/Pipelex/pipelex/blob/mainpipelex/cogt/imgg/imgg_engine.py#L6-L12" target="_blank" rel="noopener noreferrer">`pipelex.cogt.imgg.imgg_engine.ImggEngine`:6-12</a>
49+
50+
51+
### OCRWorkerAbstract
52+
An abstract base class for Optical Character Recognition services, providing a unified interface for different OCR providers. Similar to `LLMWorkerAbstract`, it defines the contract for OCR services, allowing for interchangeable OCR backends and supporting the "Tool/Service Integrations" pattern.
53+
54+
55+
**Related Classes/Methods**:
56+
57+
- <a href="https://github.com/Pipelex/pipelex/blob/mainpipelex/cogt/ocr/ocr_worker_abstract.py#L15-L73" target="_blank" rel="noopener noreferrer">`pipelex.cogt.ocr.ocr_worker_abstract.OcrWorkerAbstract`:15-73</a>
58+
59+
60+
### ContentGenerator
61+
This component orchestrates multiple AI services (primarily LLMs) to generate more complex content. It acts as a higher-level consumer of the AI abstraction layer, composing and orchestrating calls to various AI services to produce structured or creative content. It represents a key aspect of the "Pipe Executors/Runners" by defining how AI tasks are combined into meaningful workflows.
62+
63+
64+
**Related Classes/Methods**:
65+
66+
- <a href="https://github.com/Pipelex/pipelex/blob/mainpipelex/cogt/content_generation/content_generator.py#L38-L280" target="_blank" rel="noopener noreferrer">`pipelex.cogt.content_generation.content_generator.ContentGenerator`:38-280</a>
67+
68+
69+
### PluginManager
70+
Essential for the 'Extensibility/Plugin-based Architecture,' this component manages the discovery, loading, and provision of concrete AI service implementations (e.g., specific LLM or OCR providers). It facilitates the dynamic extension of AI service capabilities, which is crucial for an AI Workflow Orchestration Library to support new and evolving AI models and services.
71+
72+
73+
**Related Classes/Methods**:
74+
75+
- <a href="https://github.com/Pipelex/pipelex/blob/mainpipelex/plugins/plugin_manager.py#L4-L12" target="_blank" rel="noopener noreferrer">`pipelex.plugins.plugin_manager.PluginManager`:4-12</a>
76+
77+
78+
### Unclassified
79+
Component for all unclassified files and utility functions (Utility functions/External Libraries/Dependencies)
80+
81+
82+
**Related Classes/Methods**: _None_
83+
84+
85+
86+
### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq)

0 commit comments

Comments
 (0)