Tasks
A task is a single workload in RunLLM. It's defined by one or more Python functions that are executed in conjunction with each other. A task can either be run on a fixed schedule (e.g., every night at midnight) or be connected to a REST API and executed on-demand. Tasks are defined by the composition of primitives.
Creating Tasks
Python SDK
To create a task in Python, you simply need to define a Python function that uses one or more primitives. Decorate that function with the @task
decorator, specify what execution mode (batch or real-time), and include it in an application.
@task(name="Chat", mode="real-time")
def my_chat_fn(context):
# Define your chat functionality...
When you define an application that uses this task, it will seamlessly be deployed to the cloud.
UI
To create a new task from the UI, follow the instructions to create a new application. You can add new tasks to an application and use the DAG visualizer to edit your application. A more detailed guide is coming soon!