Deer-workflow is an open‑source library that lets you define AI pipelines as plain Python functions. The key idea is to keep the control flow, the steps, retries, branching, separate from the model prompts that actually generate text.
When orchestration lives in its own layer, you can change the underlying model without touching the workflow code. Want to swap a GPT‑4 call for a cheaper Llama model? Just replace the prompt‑function. The rest of the pipeline still knows when to call it, how to handle errors, and how to pass data forward.
This separation also makes testing easier. Unit tests can mock the semantic functions and verify that the orchestration reacts correctly to success, timeouts, or malformed output. The same tests run unchanged when you upgrade the model or add new prompt variants.
Masterphub.io lists reusable AI skills that follow this pattern. By publishing a skill built on deer‑workflow, creators give buyers a ready‑made orchestration that works with any compatible model. Buyers only need to supply their own API keys.
Another benefit is reusability across projects. A checkout‑flow that validates a user’s address, asks for shipping preferences, and confirms payment can be written once. The semantic functions for each step can be swapped out for different languages or tones, while the orchestration stays identical.
Deer-workflow also supports async execution. Long‑running calls can be scheduled without blocking the rest of the pipeline. This keeps the user experience smooth and reduces resource waste.
In short, the library encourages a clean split: orchestration handles when and how to run, semantics handle what to say. The result is a codebase that is easier to read, easier to extend, and easier to maintain.
If you are looking for a starter kit, clone the repo, define your prompt functions, and plug them into the provided Workflow class. Publish the finished workflow on Masterphub and let others run it with their own models.
We turned this idea into a ready-to-use skill on Masterphub: "Reusable checkout workflow with interchangeable prompts".