Skip to main content

A lightweight Python framework for building modular AI pipelines with function nodes and agent nodes.

Project description

Pipeline Node Agents

A lightweight Python framework for building modular AI pipelines with function nodes and agent nodes. Designed to work well with lightweight local LLMs by giving you full control over context and task complexity at each step.

Usage Guide

Requirements

  • OS: Ubuntu 20.04 or later
  • RAM: 8 GB minimum (16 GB recommended)
  • Disk: 10 GB free space
  • curl (any recent version)
  • Python 3.11 - 3.13

1) Setup Ollama

  • Install Ollama (if not already installed):

    curl -fsSL https://ollama.com/install.sh | sh
    
  • Run Ollama in a separate terminal:

    ollama serve
    
  • Install LLM (default: llama3.2:latest):

    ollama pull llama3.2:latest
    
  • Make sure the required LLM is installed using command:

    ollama list
    

Expected output:

NAME                ID              SIZE     MODIFIED
llama3.2:latest     9f1c3d6a5b8e    2.0 GB   1 minute ago

2) Install Package

  • (Optional, but recommended) create python virtual environment:

    python3 -m venv .venv && source .venv/bin/activate
    
  • Install package:

    pip install pipeline-node-agents
    

3) Verify Installation

from pipeline_node_agents import greet

print(greet())

Expected output:

Hello, World! Pipeline Node Agents <version> is working.

4) Run Pipelines

Option 1: With defined model and logger (recommended)

from crewai import LLM
from pipeline_node_agents import init_pipeline_logger, get_logger, TripPlannerPipeline

init_pipeline_logger(pipeline_name="trip_planner_pipeline", project_root=".")
logger = get_logger(__name__)

# Default model is llama3.2, change if needed
ollama_llm = LLM(model="ollama/llama3.2", base_url="http://localhost:11434")

pipeline = TripPlannerPipeline(ollama_llm=ollama_llm, logger=logger)
pipeline.run()

Option 2: Without logger

from pipeline_node_agents import TripPlannerPipeline

# Default model is llama3.2
pipeline = TripPlannerPipeline()
pipeline.run()

Available pipelines

The following pipelines are included as examples:

  • ConditioningPipeline: Randomly chooses whether to go to a park or cinema, and suggests either a film or a park in Vienna.

  • InputCheckerPipeline: Takes text as input and returns true if the text is a list of populated places (cities). Can be run as a loop, returning to the input step as long as the input is invalid: pipeline.run(loop=True)

  • RandomMeanPipeline: Simple pipeline without LLM usage that generates random numbers and calculates their mean.

  • RandomMeanPipelineCrewAI: Generates random numbers and summarizes them using an LLM.

  • SearchAndSummarizePipeline: Searches for the best country for business using DuckDuckGo and summarizes results using an LLM, returning the best country for business.

  • TripPlannerPipeline: Takes a list of cities and trip dates as input, chooses the city based on weather conditions, and creates a full 7-day trip itinerary for the provided dates.

To run one of them, replace "TripPlannerPipeline" in the code example with a class from the list above.

Example with SearchAndSummarizePipeline:

from pipeline_node_agents import SearchAndSummarizePipeline
pipeline = SearchAndSummarizePipeline()
pipeline.run()

Maintenance Guide

For detailed maintenance instructions, including how to create nodes, build pipelines, and extend the framework, please refer to the Maintenance Guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipeline_node_agents-0.1.4.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipeline_node_agents-0.1.4-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file pipeline_node_agents-0.1.4.tar.gz.

File metadata

  • Download URL: pipeline_node_agents-0.1.4.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for pipeline_node_agents-0.1.4.tar.gz
Algorithm Hash digest
SHA256 09f9c796ebf1d1ec9fb5775d350252d42fb68b752ebfd1880447458c8d6b4691
MD5 4577a884b4f1250df994eec7424959d7
BLAKE2b-256 e567a6b88b885d9825388ccde417f9d252c32835d7c356d5ed46b6a531e210e6

See more details on using hashes here.

File details

Details for the file pipeline_node_agents-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pipeline_node_agents-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 90ad9ab9007c2f8930a461e76d64d072d7758f6cb864419262f82a3adf93a31f
MD5 e9e94abf0b3441ed2440ad4a3cdedc86
BLAKE2b-256 b88ae63bcec16ca1ce30578440a302bbdb6ab1d9f1b8f9081e00a278cb1d8cea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page