coaxer
Label examples. Derive the prompt. Consume it as a string.
Full docs: https://thekevinscott.github.io/coaxer/ · ship-with-package source in docs/.
Motivation
Writing prompts by hand is slow, and the prose grows brittle as cases accumulate. Coaxer flips it: label examples of the behavior you want, derive the prompt from those labels — when it drifts, add more labels instead of rewriting.
Labels are the source of truth. The prompt is a build artifact.
Install
uv add coaxer # Python
npm install coaxer # TypeScript
Quick start
coax labels/repo-classification --out prompts/repo-classification
from coaxer import CoaxedPrompt
p = CoaxedPrompt("prompts/repo-classification")
filled = p(readme=new_readme, stars=1200)
The TypeScript version is in docs/guide/getting-started.md.
Getting Started
Label folder is one directory per record; record.json plus sibling files for large text or binary inputs. coax compiles the folder into a prompt artifact you load with CoaxedPrompt. Default optimizer is none (schema-derived, no network).
Full walkthrough: docs/guide/getting-started.md.
CoaxedPrompt
CoaxedPrompt(path, **bound) is a str subclass. str(p) is the raw template; p(**vars) renders it. Missing vars raise MissingVariableError. Bound defaults at construction; call-time vars override. p.fields lists the input variables the template expects.
For structured-output APIs, p.response_format is a Pydantic model derived from the compiled output schema.
Reference: docs/api/coaxed-prompt.md.
CLI
coax <labels-dir> --out <prompts-dir> [--optimizer {none,gepa}] [--output-name NAME]
Reference: docs/api/cli.md.
AgentLM
DSPy BaseLM backed by the Claude Agent SDK. **kwargs forward to ClaudeAgentOptions (tools, allowed_tools, max_turns, …).
from coaxer import AgentLM
lm = AgentLM(tools=[])
Reference: docs/api/agent-lm.md.
OpenAILM
DSPy BaseLM for any OpenAI-compatible chat endpoint (Ollama, vLLM, OpenAI, LM Studio, …).
from coaxer import OpenAILM
lm = OpenAILM(model="gpt-4o", base_url="https://api.openai.com/v1", api_key="sk-...")
Reference: docs/api/openai-lm.md.
Migrations
Downstream-consumer upgrade instructions for breaking changes live in MIGRATIONS.md (also published at docs/migrations.md). The full release log is in CHANGELOG.md.
Development
uv sync --extra dev
uv run just test-unit # Unit tests
uv run just ci # Full CI (lint + format + typecheck + tests)
Metadata
Release files for coaxer 0.3.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| coaxer-0.3.15.tar.gz | 66.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coaxer-0.3.15-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 119.2 kB
Release files / coaxer-0.3.15.tar.gz
| Download URL | coaxer-0.3.15.tar.gz |
|---|---|
| Size | 66.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
baf1872a72d3b6b3d17978c9dc6131c3043144ab32074bd75a241eb2a3477f7e
|
|
BLAKE2b-256 checksum How to use checksums |
b9d474c7730468a52d3889d8912cf40cdaed51a161207ee0fc3c8b46c405a0c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.
Transparency logRelease files / coaxer-0.3.15-py3-none-any.whl
| Download URL | coaxer-0.3.15-py3-none-any.whl |
|---|---|
| Size | 52.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6aaa8d9f2eb90165a78a41e42a0fbd5b28cb2f7d75b7a1a145d181ad8a7c9c89
|
|
BLAKE2b-256 checksum How to use checksums |
6106f8149d4b958a989e4a5632d63b3a213426cd7e0cf94a190e1ab9ffdb63fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.
Transparency logSecurity for coaxer 0.3.15
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for coaxer-0.3.15.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.