Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
celeste-api is the FastAPI backend service for the Celeste multi-modal AI framework. It provides unified HTTP endpoints for all Celeste capabilities including text generation, image generation/editing, video generation, audio transcription, text-to-speech, document intelligence, and reranking.
src/celeste_api/main.pysrc/celeste_api/routes/Each route module follows a consistent pattern:
src/celeste_api/routes/{capability}.py/v1 prefix and appropriate tags/v1/text/* - Text generation (sync and streaming)/v1/images/* - Image generation and editing/v1/videos/* - Video generation/v1/audio/* - Audio generation (TTS) and proxy/v1/documents/* - Document analysis and intelligence/v1/rerank - Text reranking/v1/discovery/* - Capabilities, providers, and models discoveryuv sync # Install dependencies uv add <package> # Add new dependency (never use pip install)
uvicorn celeste_api.main:app --reload --port 8000 # Development server make api # Run from parent directory
ruff check src/ # Linting ruff format src/ # Formatting mypy src/ # Type checking pre-commit run --all-files # Run all pre-commit hooks
# Manual testing with curl curl http://localhost:8000/v1/health curl http://localhost:8000/v1/capabilities # Interactive docs # Visit http://localhost:8000/docs for Swagger UI # Visit http://localhost:8000/redoc for ReDoc
src/celeste_api/routes/{capability}.pymain.pyroutes/__init__.pyfrom __future__ import annotations from celeste_{capability} import create_{capability}_client from fastapi import APIRouter router = APIRouter(prefix="/v1", tags=["{capability}"]) @router.post("/{capability}/action") async def perform_action(payload: dict) -> dict: provider = payload["provider"] model = payload.get("model") # ... extract other parameters client = create_{capability}_client(provider, model=model) result = await client.method(...) return { "result": result, "provider": provider, "model": model, "metadata": {...} }
For endpoints requiring file uploads:
from fastapi import File, UploadFile @router.post("/endpoint") async def process_file( file: UploadFile = File(...), provider: str = Form(...), model: str = Form(None) ) -> dict: content = await file.read() # Process file content
API keys are managed through celeste-core settings:
GOOGLE_API_KEY - Google servicesOPENAI_API_KEY - OpenAI servicesANTHROPIC_API_KEY - Anthropic servicesMISTRAL_API_KEY - Mistral servicesHUGGINGFACE_TOKEN - HuggingFace servicesREPLICATE_API_TOKEN - Replicate servicesCOHERE_API_KEY - Cohere servicesTOPAZ_LABS_API_KEY - Topaz Labs servicesCORS_ALLOW_ORIGINS - Comma-separated list of allowed origins (default: "*"){ "content": "...", // Main response content "provider": "provider_id", // Provider used "model": "model_id", // Model used "metadata": { // Additional information "usage": {...}, "latency": 0.123, ... } }
Uses NDJSON (newline-delimited JSON) format:
{"content": "chunk1", "metadata": {"is_stream_chunk": true}} {"content": "chunk2", "metadata": {"is_stream_chunk": true}}
fastapi>=0.111.0 - Web frameworkuvicorn[standard]>=0.30.0 - ASGI serverpydantic>=2.8.0 - Data validationpython-multipart>=0.0.9 - Multipart form supportAll celeste packages are referenced via git sources:
celeste-core - Base classes and enumsceleste-client - Text generationceleste-image-generation - Image generationceleste-image-edit - Image editingceleste-video-generation - Video generationceleste-reranking - Text rerankingceleste-document-intelligence - Document processinguv add instead of pip install for dependencies