Skip to main content

HTTP server for deploying and serving LlamaIndex workflows as web services

Project description

LlamaAgents Server

HTTP server for deploying LlamaIndex Workflows as web services. Built on Starlette and Uvicorn.

Installation

pip install llama-agents-server

Quick Start

Create a server file (e.g., my_server.py):

import asyncio
from workflows import Workflow, step
from workflows.context import Context
from workflows.events import Event, StartEvent, StopEvent
from llama_agents.server import WorkflowServer

class StreamEvent(Event):
    sequence: int

class GreetingWorkflow(Workflow):
    @step
    async def greet(self, ctx: Context, ev: StartEvent) -> StopEvent:
        for i in range(3):
            ctx.write_event_to_stream(StreamEvent(sequence=i))
        name = ev.get("name", "World")
        return StopEvent(result=f"Hello, {name}!")

server = WorkflowServer()
server.add_workflow("greet", GreetingWorkflow())

if __name__ == "__main__":
    asyncio.run(server.serve("0.0.0.0", 8080))

Or run it with the CLI:

llama-agents-server my_server.py

Features

  • REST API for running, streaming, and managing workflows
  • Debugger UI automatically mounted at / for visualizing and debugging workflows
  • Event streaming via newline-delimited JSON or Server-Sent Events
  • Human-in-the-loop support for interactive workflows
  • Persistence with built-in SQLite store (or bring your own via AbstractWorkflowStore)

Client

Use llama-agents-client to interact with deployed servers programmatically.

Documentation

See the full deployment guide for API details, persistence configuration, and more.

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

llama_agents_server-0.3.0.tar.gz (46.2 kB view details)

Uploaded Source

Built Distribution

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

llama_agents_server-0.3.0-py3-none-any.whl (65.7 kB view details)

Uploaded Python 3

File details

Details for the file llama_agents_server-0.3.0.tar.gz.

File metadata

  • Download URL: llama_agents_server-0.3.0.tar.gz
  • Upload date:
  • Size: 46.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_agents_server-0.3.0.tar.gz
Algorithm Hash digest
SHA256 736f88a80f3cd30127958a1d667524aa35604daf70147f8f603f0b389c1d37c2
MD5 b06216a92a905b988c96c10f84c11967
BLAKE2b-256 dfa2dd4ef7cbf0c00cd6190909593020b3fb3aa813d7507ac3d831a271b9127c

See more details on using hashes here.

File details

Details for the file llama_agents_server-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: llama_agents_server-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 65.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_agents_server-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21a9c668ee4e325b570dc741eb3391532b8e759e5a532376bf3ff427ec10e416
MD5 1a37f9a06ab0480bf53c3796b9298efd
BLAKE2b-256 f1a943dacc77f27920024c3f4d672f8354c32e7f99c447f036e67b4165176164

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