AIPE (AI Pipeline Engine) is a flexible and powerful tool for creating and executing complex AI workflows. It allows you to chain together various AI tasks such as web searching, text generation, speech processing, and image generation into a cohesive pipeline, all configurable through a simple YAML file.
- 🔗 Chain multiple AI tasks into a single workflow
- 🔍 Web search integration (DuckDuckGo and Serper API)
- 🤖 Text generation using various LLM models (Ollama, OpenAI)
- 🗣️ Text-to-Speech and Speech-to-Text capabilities
- 🖼️ Image generation using Stable Diffusion
- 🌐 Webhook integration for external API calls
- 📄 YAML-based configuration for easy pipeline setup
- 🔄 Dynamic binding of context and step outputs
AIPE (AI Pipeline Engine) is a versatile tool that can be applied to various domains and tasks. Here are some potential use cases:
-
Automated Research Assistant: Create a pipeline that searches the web for a specific topic, summarizes the findings, and generates a comprehensive report with citations.
-
Content Creation Workflow: Design a pipeline that generates article ideas, writes draft content, creates accompanying images, and prepares social media posts for promotion.
-
Sentiment Analysis and Brand Monitoring: Set up a pipeline that scrapes social media and news sites for mentions of a brand, performs sentiment analysis, and generates daily reports with insights.
-
Automated Customer Support: Develop a pipeline that processes customer inquiries, searches a knowledge base for relevant information, and generates personalized responses.
-
Data Analysis and Visualization: Create a pipeline that collects data from various sources, performs statistical analysis, generates insights, and creates data visualizations.
-
Language Translation Service: Build a pipeline that takes text in one language, translates it to multiple target languages, and generates audio pronunciations for each translation.
-
Automated Code Review: Design a pipeline that analyzes code repositories, identifies potential issues or improvements, and generates detailed code review reports.
-
Market Trend Analysis: Set up a pipeline that monitors financial news, analyzes market data, and generates predictive reports on potential market trends.
-
Educational Content Generation: Create a pipeline that takes a subject area, generates educational content, quizzes, and supplementary materials for online courses.
-
Personalized News Aggregator: Develop a pipeline that collects news from various sources based on user preferences, summarizes articles, and generates a personalized daily news briefing.
These use cases demonstrate the flexibility and power of AIPE in automating complex workflows across different industries and applications. The modular nature of the pipeline allows for easy customization and expansion to suit specific needs.
The AI Agent Pipeline Engine supports the following steps:
WebSearch
: Search the web using DuckDuckGo or Serper APIWebScrape
: Scrape content from specified URLsRunInference
: Generate text using LLM models (Ollama, OpenAI)TextToSpeech
: Convert text to speechSpeechToText
: Transcribe speech to textLoadImageModel
: Load a text-to-image modelGenerateImage
: Generate images from text promptsCallWebhook
: Make external API calls
-
Clone the repository:
git clone https://github.com/yourusername/AIPE.git cd AIPE
-
Install the required dependencies:
pip install -r app/requirements.txt
-
Set up environment variables for API keys (if needed):
export OPENAI_API_KEY=your_openai_api_key export SERPER_API_KEY=your_serper_api_key
-
Create a YAML configuration file for your pipeline. Example:
pipeline: context: topic: "artificial intelligence with crypto" num_results: 5 model_name: "llama2" steps: - name: "web_search" type: "WebSearch" query: "latest developments in {context.topic}" search_type: "serper" num_results: "{context.num_results}" - name: "summarize_findings" type: "RunInference" source: "ollama" model_name: "llama2" prompt: "Summarize the latest developments in {context.topic} based on the following information: {steps.web_search}" - name: "text_to_speech" type: "TextToSpeech" text: "{steps.summarize_findings}" result_path: "/app/output/summary_audio.wav" - name: "generate_image" type: "GenerateImage" prompt: "A futuristic representation of {context.topic}" result_path: "/app/output/ai_developments.png" image_params: num_inference_steps: 50 guidance_scale: 7.5 - name: "final_report" type: "RunInference" source: "ollama" model_name: "llama2" prompt: "Create a final report on {context.topic} incorporating the following elements:\n1. Web search results: {steps.web_search}\n2. Summarized findings: {steps.summarize_findings}\n4. Generated image description: A futuristic representation of {context.topic}\n5. Transcription accuracy check: Compare the original summary with the transcribed text and comment on any discrepancies." result_path: "/app/output/final_report.txt"
-
Run the pipeline:
python app/main.py config/config.yaml
-
Check the output: The pipeline will save its outputs in the
output
folder. This includes generated files such as audio, images, and text reports as specified in your configuration.
The project includes Dockerfile for easy containerization. To build and run using Docker:
docker build -t AIPE .
docker run -it --gpus all --env-file .env AIPE
The pipeline will save its outputs in the output
folder inside the docker container. This includes generated files such as audio, images, and text reports as specified in your configuration.
To deploy your AIPE project on Spheron:
-
Update
spheron.yaml
in your project root with your image details. -
Install
spheronctl
CLI: Installation Guide -
Create deployment:
sphnctl deployment create spheron.yaml
-
Check deployment status (replace
<LID>
with your Deployment ID):sphnctl deployment get --lid <LID>
-
View deployment logs:
sphnctl deployment logs --lid <LID>
-
Access deployment shell:
sphnctl deployment shell aipet /bin/sh --lid <LID> --stdin --tty
For more details, see Spheron Docs.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions, feel free to reach out to Mitra.