Lightweight LLM orchestration for Python

LLM workflows,
without the framework tax.

TinyTune gives prompts a place to live: composable prompt jobs, explicit pipelines, model-agnostic contexts, and plain Python tools.

$ pip install tinytune
workflow.py
from tinytune import GPTContext, Pipeline, prompt_job, Message

context = GPTContext("o1-mini", OPENAI_API_KEY)

@prompt_job(id="summarize", context=context)
def summarize(id, context, prevResult):
    return (context
        .Prompt(Message("user", "Summarize the signal."))
        .Run(stream=True)
        .Messages[-1])

pipeline = Pipeline(context)
pipeline.AddJob(summarize)
result = pipeline.Run()
Prompt jobsTurn prompt logic into named, reusable units.
PipelinesCompose jobs into explicit, readable workflows.
Model agnosticKeep orchestration separate from your model backend.
Plain Python toolsExtend workflows with normal callable functions.
The point

Structure the part of your LLM code that usually turns into glue.

Prompts start as strings. Then they gain context, retries, steps, tools, and dependencies. TinyTune gives that logic a small set of primitives without asking your application to become an agent platform.

01 / JOBS

Prompts become code units.

Wrap prompt behavior with @prompt_job, give it an identity, and keep it reusable instead of scattering strings across handlers and services.

02 / FLOW

The workflow stays obvious.

A pipeline is a sequence you can read. Each job can receive the previous result, making multi-step LLM work explicit instead of hidden behind magic.

03 / EXTENSION

Tools stay Python.

Decorate regular functions as tools and plug real application capability into your LLM flow without inventing another runtime or DSL.

Small surface area

Enough abstraction to organize. Not enough to own your app.

TinyTune is deliberately legible. The core concepts map directly to things you already have: a model context, a unit of prompt work, a sequence, and callable functions.

ctx
LLMContext

Owns model interaction and message history while keeping the rest of your workflow independent of a specific backend.

@
PromptJob

Packages one prompt-driven task into a reusable function with a stable identity and context.

Pipeline

Runs jobs in sequence and passes results forward, so multi-step behavior remains inspectable.

fn
Tool

Turns a Python function into capability your LLM workflow can reason about and invoke.

Instead of

Prompt strings everywhere.

Business logic coupled to one provider, ad-hoc sequencing, duplicated context handling, and glue that gets harder to reason about every time the workflow grows.

TinyTune

A few primitives with sharp boundaries.

Jobs describe work. Pipelines describe order. Contexts describe model interaction. Tools describe capability. The rest stays your application.

Start tiny

Install it, write one job, build from there.

No generated project. No runtime service. No ceremony before your first prompt pipeline.