Metadata-Version: 2.4
Name: launchpad-ai
Version: 0.1.2
Summary: Turn AI/ML research into production-ready capabilities with typed Pydantic contracts, exposed through pluggable delivery adapters (HTTP, CLI, gRPC, queues).
Project-URL: Homepage, https://github.com/sankalpshekhar14/launchpad
Project-URL: Source, https://github.com/sankalpshekhar14/launchpad
Project-URL: Issue Tracker, https://github.com/sankalpshekhar14/launchpad/issues
Author-email: Sankalp Shekhar <sankalp.shekhar14@gmail.com>
License: Apache-2.0
License-File: LICENSE
Keywords: agents,ai,capability,fastapi,llm,ml,pydantic,sdk
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: pydantic>=2.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0
Requires-Dist: typer>=0.12
Provides-Extra: all
Requires-Dist: fastapi>=0.111; extra == 'all'
Requires-Dist: mcp>=1.0; extra == 'all'
Requires-Dist: uvicorn[standard]>=0.30; extra == 'all'
Provides-Extra: http
Requires-Dist: fastapi>=0.111; extra == 'http'
Requires-Dist: uvicorn[standard]>=0.30; extra == 'http'
Provides-Extra: mcp
Requires-Dist: mcp>=1.0; extra == 'mcp'
Description-Content-Type: text/markdown

# Launchpad

Launchpad provides a standardized way to turn AI/ML research implementations into reusable, production-ready capabilities. Define your capability once with typed Pydantic contracts — Launchpad handles how it gets delivered.

## Why Launchpad?

AI teams repeatedly solve the same problems: wrapping a model call in retry logic, exposing a capability as an API, logging inputs/outputs for evaluation, versioning prompts. Launchpad makes this a one-time effort.

You implement a capability once. Launchpad handles:
- **Multiple delivery mechanisms** — REST API, MCP tool, gRPC, CLI, async queue
- **Typed contracts** — Pydantic models as first-class input/output schemas, validated at every boundary
- **Manifest-driven configuration** — adapters configured via `launchpad.yml`, not hardcoded kwargs
- **Observability** — structured logging and eval hooks out of the box
- **Reliability** — retries, fallbacks, circuit breakers (coming soon)

## Core Concepts

| Concept | Description |
|---|---|
| **Capability** | A typed, self-contained AI function: `Capability[InputModel, OutputModel]` |
| **Adapter** | A delivery mechanism that exposes a capability (HTTP, MCP, gRPC, etc.) |
| **Manifest** | A `launchpad.yml` file that configures how a capability is exposed |

## Quick Start

```bash
pip install launchpad-ai
pip install 'launchpad-ai[http]'   # HTTP adapter
pip install 'launchpad-ai[mcp]'    # MCP adapter
```

Define your contracts as Pydantic models, then implement the capability:

```python
from pydantic import BaseModel
from launchpad import Capability, capability

class SummarizeInput(BaseModel):
    text: str
    max_length: int = 200

class SummarizeOutput(BaseModel):
    summary: str

@capability(name="summarize", version="1.0")
class Summarize(Capability[SummarizeInput, SummarizeOutput]):
    def run(self, input: SummarizeInput) -> SummarizeOutput:
        # your implementation here
        ...
```

Use it directly:

```python
result = Summarize().run(SummarizeInput(text="..."))
print(result.summary)
```

### Serve over HTTP

```python
from launchpad.adapters.http import HttpAdapter

HttpAdapter(Summarize).serve()
# POST /summarize  →  { "text": "...", "max_length": 200 }
# GET  /health
# GET  /docs       (OpenAPI)
```

### Expose as an MCP tool

```python
from launchpad.adapters.mcp import McpAdapter

McpAdapter.from_manifest(Summarize, "launchpad.yml").serve()
# Any MCP client (Claude Desktop, Claude Code) can now call "summarize" as a native tool
```

### Configure via manifest

```yaml
# launchpad.yml
metadata:
  version: "1.0"

spec:
  interfaces:
    http:
      enabled: true
      host: 0.0.0.0
      port: 8080
      route_prefix: /v1
      cors:
        origins: ["*"]

    mcp:
      enabled: true
      transport: stdio   # or sse, streamable-http
```

```python
HttpAdapter.from_manifest(Summarize, "launchpad.yml").serve()
McpAdapter.from_manifest(Summarize, "launchpad.yml").serve()
```

### Structured logging

Logging is automatic — every capability call emits structured log events with no extra code:

```
capability.run.start    — capability, version, input
capability.run.success  — + duration_ms, output
capability.run.error    — + duration_ms, error, error_type
```

To get JSON output:

```python
import logging
from launchpad import JsonFormatter

handler = logging.StreamHandler()
handler.setFormatter(JsonFormatter())
logging.getLogger("launchpad.capability").addHandler(handler)
```

Set `log_io = False` on a capability to suppress payload logging for sensitive data.

### Eval hooks

Plug in evaluation logic that runs after every successful capability call:

```python
from launchpad import EvalHook, EvalContext

class MyEvalHook(EvalHook):
    def on_run(self, ctx: EvalContext) -> None:
        print(ctx.capability, ctx.duration_ms, ctx.output)

Summarize.eval_hooks.append(MyEvalHook())
```

## Project Structure

```
launchpad/
├── src/launchpad/
│   ├── core/          # Capability[I,O] base class and @capability decorator
│   ├── adapters/      # http/, mcp/ — one folder per adapter
│   ├── config/        # ManifestConfig and per-adapter interface configs
│   ├── observability/ # Structured logging, JsonFormatter, EvalHook
│   └── pipeline/      # Capability composition (coming soon)
├── examples/          # Self-contained runnable examples
└── tests/
```

## Documentation

See [AGENTS.md](AGENTS.md) for conventions used when building capabilities and adapters in this repo.

## License

Apache 2.0
