Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Runlet

PyPI version Python versions CI Docs

Runlet is a small, provider-neutral Python agent runtime library.

It is designed for applications that want explicit control over model calls, tool execution, context budgeting, and structured observability without adopting a large framework.

When to use Runlet

Runlet is a good fit when you want to:

  • embed agent execution inside an existing Python application
  • keep model providers behind adapters
  • enforce context preparation before model calls
  • stream model output while still executing tools inside the runtime loop
  • observe runs through structured events
  • build your own application-level conversation, memory, or state policies

When not to use Runlet

Runlet is not trying to be:

  • a hosted agent platform
  • a web framework
  • a graph workflow engine
  • a UI or trace viewer
  • a full memory framework

If you want a batteries-included platform with orchestration, persistence, and application scaffolding built in, Runlet is intentionally narrower than that.

Quickstart

Install Runlet:

pip install runlet

Install the OpenAI optional dependency:

pip install "runlet[openai]"

Install the Anthropic optional dependency:

pip install "runlet[anthropic]"

If you prefer .env based local development:

pip install python-dotenv

Example .env:

OPENAI_API_KEY=your-api-key
OPENAI_BASE_URL=https://your-endpoint.example/v1
OPENAI_MODEL=qwen-plus

Minimal example:

import asyncio
import os

from dotenv import load_dotenv

from runlet import Agent, Runtime
from runlet.providers import OpenAIChatCompletionsProvider


async def main() -> None:
    load_dotenv()

    provider = OpenAIChatCompletionsProvider(
        model=os.environ.get("OPENAI_MODEL", "gpt-4o-mini"),
        api_key=os.environ["OPENAI_API_KEY"],
        base_url=os.environ.get("OPENAI_BASE_URL"),
    )

    agent = Agent(
        name="assistant",
        instructions="Be concise and helpful.",
        model=provider,
    )

    result = await Runtime().run(agent, "用一句中文介绍 Runlet。")
    print(result.output)


asyncio.run(main())

Core capabilities

  • provider-neutral runtime loop
  • async model execution
  • streaming text output
  • runtime-managed streaming tool execution
  • request-level provider options
  • structured runtime events
  • hook points around model and tool execution
  • lightweight state store primitives

Documentation

Start here:

Guides:

Concepts:

Project background:

Providers

Runlet currently includes three built-in providers:

  • OpenAIChatCompletionsProvider
  • OpenAIResponsesProvider
  • AnthropicMessagesProvider

For most third-party OpenAI-compatible gateways, start with OpenAIChatCompletionsProvider. It is usually the more portable option.

For Anthropic's official API, use AnthropicMessagesProvider.

Project status

Runlet is currently in beta. The API may still evolve before a stable 0.x release.

Development

Run the test suite:

PYTHONPATH=src python3 -m unittest discover tests

Run type checking:

pyright

Release

Runlet publishes to PyPI from Git tags through GitHub Actions.

Typical release flow:

  1. Update the version in pyproject.toml
  2. Merge to main
  3. Create a tag such as v0.2.0b3
  4. Push the tag
git tag v0.2.0b3
git push origin v0.2.0b3

Download files

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

Source Distribution

runlet-0.2.0b3.tar.gz (50.7 kB view details)

Uploaded Source

Built Distribution

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

runlet-0.2.0b3-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file runlet-0.2.0b3.tar.gz.

File metadata

  • Download URL: runlet-0.2.0b3.tar.gz
  • Upload date:
  • Size: 50.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for runlet-0.2.0b3.tar.gz
Algorithm Hash digest
SHA256 ea909abc9ed557804c3b5b9bbddfae300572b413b1b65b86de2a6e592e8fd6c1
MD5 84f4f10d3fc51140d6b38b3d1fc0fee9
BLAKE2b-256 370cd282f2627f6abd04af330c4c82920832028500ba473bbe10f1448feac1af

See more details on using hashes here.

Provenance

The following attestation bundles were made for runlet-0.2.0b3.tar.gz:

Publisher: publish.yml on DMIAOCHEN/runlet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file runlet-0.2.0b3-py3-none-any.whl.

File metadata

  • Download URL: runlet-0.2.0b3-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for runlet-0.2.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 56dc2dfb09e1e61dc2b5abc23345ad6df2315ced988832423749915c3315f2c4
MD5 f2f81e47fbd4236d5deebbeb853af549
BLAKE2b-256 bcf21047181abfceea07f4d43266a1436f5b94dea5b9fd9d6f2e5d2f2ac732ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for runlet-0.2.0b3-py3-none-any.whl:

Publisher: publish.yml on DMIAOCHEN/runlet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0b3 This release

2 files

0.1.0

2 files

Supported by

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