Skip to main content

Modular Python framework for LLM workflows, tools, memory, and data.

Project description

griptape

PyPI Version Tests Docs Griptape Discord

griptape is a modular Python framework for LLM workflows, tools, memory, and data that enables developers to:

  1. 🤖 Build AI agents, sequential LLM pipelines and sprawling DAG workflows for complex use cases.
  2. ⛓️ Augment LLMs with chain of thought capabilities.
  3. 🧰️ Integrate other services and functionality into LLMs as tools (e.g., calculators, web scrapers, spreadsheet editors, and API connectors); run tools in any environment (local, containerized, cloud, etc.); use tools directly in griptape or convert them into ramps abstractions, such as ChatGPT Plugins, LangChain tools, or Fixie.ai agents.
  4. 💾 Add memory to AI pipelines for context preservation and summarization.

Documentation

Please refer to Griptape Docs for:

  • Getting started guides.
  • Core concepts and design overviews.
  • Examples.
  • Contribution guidelines.

Quick Start

First, install griptape and griptape-tools:

pip install griptape griptape-tools -U

Second, configure an OpenAI client by getting an API key and adding it to your environment as OPENAI_API_KEY. griptape uses OpenAI Completions API to execute LLM prompts and to work with LlamaIndex data structures.

With griptape, you can create structures, such as Agents, Pipelines, and Workflows, that are composed of different types of tasks. You can also define structures as JSON objects and load them into griptape dynamically. Let's define a simple two-task pipeline that uses tools:

from decouple import config
from griptape.core import ToolLoader
from griptape.drivers import OpenAiPromptDriver, MemoryStorageDriver
from griptape.executors import LocalExecutor
from griptape.memory import Memory
from griptape.ramps import StorageRamp
from griptape.structures import Pipeline
from griptape.tasks import ToolkitTask, PromptTask
from griptape.tools import WebScraper

storage = StorageRamp(
    driver=MemoryStorageDriver()
)

scraper = WebScraper(
    ramps={
        "get_content": [storage]
    }
)

pipeline = Pipeline(
    memory=Memory(),
    tool_loader=ToolLoader(
        tools=[scraper],
        executor=LocalExecutor()
    )
)

pipeline.add_tasks(
    ToolkitTask(
        tool_names=[scraper.name]
    ),
    PromptTask(
        "Say the following in spanish: {{ input }}"
    )
)

result = pipeline.run("Give me a summary of https://en.wikipedia.org/wiki/Large_language_model")

print(result.output.value)

Boom! Our first LLM pipeline with two sequential tasks generated the following exchange:

Q: Give me a summary of https://en.wikipedia.org/wiki/Large_language_model
[chain of thought output... will vary depending on the model driver you're using]
A: Los modelos de lenguaje de gran tamaño son herramientas utilizadas para tareas de 
procesamiento del lenguaje natural, como detectar falsedades, completar oraciones y comprender 
el lenguaje. Algunos modelos notables incluyen BERT, GPT-2, GPT-3, GPT-Neo y GLaM. The Pile es 
un conjunto de datos extenso utilizado para el modelado del lenguaje. Estos modelos han sido 
desarrollados e investigados en trabajos como TruthfulQA, HellaSwag y BERT: Pre-entrenamiento 
de transformadores bidireccionales profundos para la comprensión del lenguaje.

Versioning

griptape is in early development and its APIs and documentation are subject to change. Until we stabilize the API and release version 1.0.0, we will use minor versions (i.e., x.Y.z) to introduce features and breaking features, and patch versions (i.e., x.y.Z) for bug fixes.

Contributing

Contributions in the form of bug reports, feature ideas, or pull requests are super welcome! Take a look at the current issues and if you'd like to help please submit a pull request with some tests.

License

griptape is available under the Apache 2.0 License.

Project details


Release history Release notifications | RSS feed

This version

0.7.3

Download files

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

Source Distribution

griptape-0.7.3.tar.gz (37.9 kB view details)

Uploaded Source

Built Distribution

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

griptape-0.7.3-py3-none-any.whl (68.1 kB view details)

Uploaded Python 3

File details

Details for the file griptape-0.7.3.tar.gz.

File metadata

  • Download URL: griptape-0.7.3.tar.gz
  • Upload date:
  • Size: 37.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.9.16 Darwin/21.6.0

File hashes

Hashes for griptape-0.7.3.tar.gz
Algorithm Hash digest
SHA256 713d0f5b2958aca5a3cf919334e9b4329c9a8d65490546dfceb42191b391daa2
MD5 96f6cd7b09d78f26aaefced01354e565
BLAKE2b-256 747765f0218016115d4bf29f7e75803dbfc023ecd60aa221acb95fc8047cc346

See more details on using hashes here.

File details

Details for the file griptape-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: griptape-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 68.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.9.16 Darwin/21.6.0

File hashes

Hashes for griptape-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8697bbba1c35331218c6e26dea4f35faf4cda3f54badb7a85e5595d2dd7bc4b4
MD5 25b17df8342f82152b581902cc50aa3f
BLAKE2b-256 6eae2b714b55c7d744550081094f256def31be6ef57af85565b6f338165a145a

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