Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Built with Next.js and Fumadocs.
[![Fumadocs](https://img.shields.io/badge/Fumadocs-Documentation-blueviolet?style=for-the-badge&logo=markdown)](https://fumadocs.vercel.app)
[![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-Styling-38B2AC?style=for-the-badge&logo=tailwind-css)](https://tailwindcss.com)
[![Biome](https://img.shields.io/badge/Biome-Linting-yellow?style=for-the-badge&logo=biome)](https://biomejs.dev)
[![License](https://img.shields.io/badge/License-Apache_2.0-red?style=for-the-badge)](LICENSE)
[![License](https://img.shields.io/badge/License-MIT-yellow?style=for-the-badge)](LICENSE)

[Documentation](https://withceleste.ai/docs) • [GitHub](https://github.com/withceleste/docs)

Expand Down Expand Up @@ -60,8 +60,8 @@ bun run start
The documentation is organized into the following sections:

- **Getting Started**: Installation and quick start guides
- **Core Concepts**: Client, capabilities, and providers
- **Capabilities**: Text, image, video, and speech generation
- **Core Concepts**: Client, modalities, and providers
- **Modalities**: Text, image, video, and speech generation
- **Providers**: Provider-specific documentation
- **Guides**: Streaming, error handling, and multi-modal workflows

Expand Down Expand Up @@ -113,7 +113,7 @@ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

## 📄 License

Apache 2.0 license – see [LICENSE](LICENSE) for details.
MIT license – see [LICENSE](LICENSE) for details.

---

Expand Down
265 changes: 259 additions & 6 deletions bun.lock

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "node_modules/@fumadocs/cli/dist/schema/src.json",
"aliases": {
"uiDir": "./components/ui",
"componentsDir": "./components",
"blockDir": "./components",
"cssDir": "./styles",
"libDir": "./lib"
},
"baseDir": "src",
"uiLibrary": "radix-ui",
"commands": {}
}
57 changes: 0 additions & 57 deletions content/docs/capabilities/image-generation.mdx

This file was deleted.

65 changes: 0 additions & 65 deletions content/docs/capabilities/speech-generation.mdx

This file was deleted.

66 changes: 0 additions & 66 deletions content/docs/capabilities/text-generation.mdx

This file was deleted.

56 changes: 0 additions & 56 deletions content/docs/capabilities/video-generation.mdx

This file was deleted.

78 changes: 78 additions & 0 deletions content/docs/contributing/adding-a-provider.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: Adding a Provider
description: How to implement a new provider for an existing modality.
---

# Adding a Provider

Celeste makes it easy to add support for new AI providers. This guide outlines the steps to implement a new provider within an existing modality package.

## Directory Structure

Providers live under the monolith at `src/celeste/modalities/<modality>/providers/`.

For example, to add a provider to the `images` modality:

```
src/celeste/modalities/images/providers/
└── {provider_slug}/
├── __init__.py
├── client.py
├── models.py
└── parameters.py
```

## Implementation Steps

### 1. Create the Provider Package

Create a new directory for your provider using the slug (e.g., `midjourney`, `stability`). You can also start from the templates in `templates/providers/` for a full scaffold.

### 2. Implement the Client (`client.py`)

The client implementation handles the communication with the provider's API.

- Inherit from the modality's base client or a specific internal interface.
- Implement the `_make_request` or equivalent method to send data to the API.
- Map the provider's response to the Celeste standard `Output` objects defined in `io.py`.

### 3. Define Models (`models.py`)

List the available models supported by this provider for this modality.

```python
from celeste.models import Model
from celeste.core import Modality, Operation

MODELS = [
Model(
id="provider-model-v1",
provider="new_provider",
operations={
Modality.IMAGES: {Operation.GENERATE}
}
)
]
```

### 4. Map Parameters (`parameters.py`)

Map Celeste's standard parameters (like `quality`, `size`) to the provider's specific API parameters.

- Use `ParameterMapper` classes to handle conversions.
- Ensure that provider-specific parameters are handled gracefully.

### 5. Register the Provider (`__init__.py`)

Expose the client and models in the provider's `__init__.py` so they can be discovered by the core registry.

## Testing

1. **Unit Tests**: Create tests in `tests/unit_tests/` to verify parameter mapping and response parsing without making network calls.
2. **Integration Tests**: Create tests in `tests/integration_tests/` to verify actual API interaction (requires API keys).

## Best Practices

- **Type Safety**: Use full type hints for all methods.
- **Error Handling**: Catch provider-specific errors and raise Celeste's standard exceptions where appropriate.
- **Documentation**: Add docstrings to your classes and methods explaining any provider-specific behaviors.
Loading