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.0b4.tar.gz (55.2 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.0b4-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: runlet-0.2.0b4.tar.gz
  • Upload date:
  • Size: 55.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for runlet-0.2.0b4.tar.gz
Algorithm Hash digest
SHA256 9010c93dbb91726fc65d20318cd1f48b9b0cb68863970d1051795ae17a80d039
MD5 98a8401b9644d40ceb1c4a595fd98d89
BLAKE2b-256 2b17742cbfc2f967c7657422a3dad72296d2de5e22f7da62690cbf498eab4d8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for runlet-0.2.0b4.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.0b4-py3-none-any.whl.

File metadata

  • Download URL: runlet-0.2.0b4-py3-none-any.whl
  • Upload date:
  • Size: 33.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for runlet-0.2.0b4-py3-none-any.whl
Algorithm Hash digest
SHA256 07db017672f4ae50e3b40e42e67f1a5cd1ba8829160eb1f2dcc3278ce555acdb
MD5 6d0dbd193ee1fbccb7e8f9f29c9f8f1f
BLAKE2b-256 b6edae376c33aa853d73edd17cb36df48a681f99b3c5bd9a7d940bb7d54e1457

See more details on using hashes here.

Provenance

The following attestation bundles were made for runlet-0.2.0b4-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.0b4 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