or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/modal@1.1.x
tile.json

tessl/pypi-modal

tessl install tessl/pypi-modal@1.1.0

Python client library for Modal, a serverless cloud computing platform that enables developers to run Python code in the cloud with on-demand access to compute resources.

Agent Success

Agent success rate when using this tile

85%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.6x

Baseline

Agent success rate without this tile

53%

task.mdevals/scenario-3/

Image Thumbnail Generator

Build a serverless image thumbnail generation service that processes multiple images in parallel and tracks processing results.

Capabilities

Parallel Image Processing

  • Given a list of image URLs, the system processes all images in parallel and returns a dictionary mapping URLs to thumbnail file paths @test
  • Each image is downloaded, resized to 200x200 pixels, and returned as bytes @test
  • The parallel processing completes faster than sequential processing for 5+ images @test

Result Caching

  • Successfully processed thumbnails are cached with the image URL as the key @test
  • Requesting a previously processed image returns the cached result without reprocessing @test

Asynchronous Task Execution

  • The service can trigger thumbnail generation for a single image without waiting for completion @test
  • The asynchronous call returns immediately with a job identifier @test

Implementation

@generates

API

def generate_thumbnail(image_url: str) -> bytes:
    """
    Generate a thumbnail for a single image.

    Args:
        image_url: URL pointing to an image to process

    Returns:
        Thumbnail image as bytes (200x200 PNG)

    Raises:
        ValueError: If image_url is invalid or image cannot be processed
    """
    pass

def process_images_parallel(image_urls: list[str]) -> dict[str, bytes]:
    """
    Process multiple images in parallel and generate thumbnails.

    Args:
        image_urls: List of URLs pointing to images to process

    Returns:
        Dictionary mapping image URLs to thumbnail bytes

    Raises:
        ValueError: If image_urls is empty
    """
    pass

def generate_thumbnail_async(image_url: str) -> str:
    """
    Asynchronously generate a thumbnail without waiting for completion.

    Args:
        image_url: URL pointing to an image to process

    Returns:
        Function call ID for tracking the async execution
    """
    pass

def get_cached_thumbnail(image_url: str) -> bytes | None:
    """
    Retrieve a cached thumbnail if it exists.

    Args:
        image_url: URL of the image to look up

    Returns:
        Cached thumbnail bytes or None if not found
    """
    pass

Dependencies { .dependencies }

modal { .dependency }

Provides serverless compute infrastructure for parallel execution.

Pillow { .dependency }

Python imaging library for image processing operations.