Florian Hönicke ee14ef5fab docs: update readme
2023-04-08 19:00:47 +02:00
2023-04-04 19:15:29 +02:00
2023-04-04 19:29:05 +02:00
2023-04-08 15:21:38 +02:00
2023-04-04 19:50:39 +02:00
2023-04-08 14:53:12 +02:00
2023-04-06 16:44:11 +02:00
2023-04-05 16:11:18 +02:00
2023-04-04 19:51:00 +02:00
2023-04-08 19:00:47 +02:00
2023-04-06 16:44:11 +02:00
2023-04-08 15:21:38 +02:00

GPT Deploy: The Microservice Magician 🧙🚀

Jina NOW logo

Turn your natural language descriptions into fully functional, deployed microservices with a single command! Your imagination is the limit!

Test Coverage Package version Supported Python versions Supported platforms

This project streamlines the creation and deployment of microservices. Simply describe your task using natural language, and the system will automatically build and deploy your microservice. To ensure the executor accurately aligns with your intended task, you can also provide test scenarios.

Quickstart

Installation

pip install gptdeploy
gptdeploy configure --key <your openai api key>

If you set the environment variable OPENAI_API_KEY, the configuration step can be skipped.

run

gptdeploy --description "Given a PDF, return it's text" --test "https://www.africau.edu/images/default/sample.pdf"

Overview

The graphic below illustrates the process of creating a microservice and deploying it to the cloud.

graph TB
    AA[Task: Generate QR code from URL] --> B{think a}
    AB[Test: https://www.example.com] --> B{think a}
    B -->|Identify Strategie 1| C[Strategy 1]
    B -->|Identify Strategie 2| D[Strategy 2]
    B -->|Identify Strategie N| E[Strategy N]
    C --> F[executor.py, test_executor.py, requirements.txt, Dockerfile]
    D --> G[executor.py, test_executor.py, requirements.txt, Dockerfile]
    E --> H[executor.py, test_executor.py, requirements.txt, Dockerfile]
    F --> I{Build Image}
    G --> I
    H --> I
    I -->|Fail| J[Apply Fix and Retry]
    J --> I
    I -->|Success| K[Push Docker Image to Registry]
    K --> L[Deploy Microservice]
    L --> M[Create Streamlit Playground]
    M --> N[User Tests Microservice]
  1. GPT Deploy identifies several strategies to implement your task.
  2. It tests each strategy until it finds one that works.
  3. For each strategy, it creates the following files:
  • executor.py: This is the main implementation of the microservice.
  • test_executor.py: These are test cases to ensure the microservice works as expected.
  • requirements.txt: This file lists the packages needed by the microservice and its tests.
  • Dockerfile: This file is used to run the microservice in a container and also runs the tests when building the image.
  1. GPT Deploy attempts to build the image. If the build fails, it uses the error message to apply a fix and tries again to build the image.
  2. Once it finds a successful strategy, it:
  • Pushes the Docker image to the registry.
  • Deploys the microservice.
  • Creates a Streamlit playground where you can test the microservice.
  1. If it fails 10 times in a row, it moves on to the next approach.

Examples

3d model info

gptdeploy --description "Given a 3d object, return vertex count and face count" --test "https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/models/wolf.obj"
3D Model Info

Table extraction

--description "Given a URL, extract all tables as csv" --test "http://www.ins.tn/statistiques/90"
Table Extraction

Audio to mel spectrogram

gptdeploy --description "Create mel spectrograms from audio file" --test "https://cdn.pixabay.com/download/audio/2023/02/28/audio_550d815fa5.mp3"
Audio to Mel Spectrogram

Text to speech

gptdeploy --description "Convert text to speech" --test "Hello, welcome to GPT Deploy!"

Text to Speech

QR Code Generator

gptdeploy --description "Generate QR code from URL" --test "https://www.example.com"
QR Code Generator

TO BE TESTED

ASCII Art Generator

gptdeploy --description "Convert image to ASCII art" --test "https://images.unsplash.com/photo-1602738328654-51ab2ae6c4ff"

Color Palette Generator

gptdeploy --description "creates aesthetically pleasing color palettes based on a seed color, using color theory principles like complementary or analogous colors" --test "red"

Password Strength Checker

gptdeploy --description "Given a password, return a score from 1 to 10 indicating the strength of the password" --test "Pa$$w0rd"

Morse Code Translator

gptdeploy --description "Convert text to morse code" --test "Hello, welcome to GPT Deploy!"

IP Geolocation

gptdeploy --description "Given an IP address, return the geolocation information" --test "142.251.46.174"

Rhyme Generator

gptdeploy --description "Given a word, return a list of rhyming words using the datamuse api" --test "hello"

Currency Converter

gptdeploy --description "Converts any currency into any other" --test "1 usd to eur"

Image Resizer

gptdeploy --description "Given an image, resize it to a specified width and height" --test "https://images.unsplash.com/photo-1602738328654-51ab2ae6c4ff"

Weather API

gptdeploy --description "Given a city, return the current weather" --test "Berlin"

Sudoku Solver

gptdeploy --description "Given a sudoku puzzle, return the solution" --test "[[2, 5, 0, 0, 3, 0, 9, 0, 1], [0, 1, 0, 0, 0, 4, 0, 0, 0], [4, 0, 7, 0, 0, 0, 2, 0, 8], [0, 0, 5, 2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 9, 8, 1, 0, 0], [0, 4, 0, 0, 0, 3, 0, 0, 0], [0, 0, 0, 3, 6, 0, 0, 7, 2], [0, 7, 0, 0, 0, 0, 0, 0, 3], [9, 0, 3, 0, 0, 0, 6, 0, 4]]"

Carbon Footprint Calculator

gptdeploy --description "Estimate a company's carbon footprint based on factors like transportation, electricity usage, waste production etc..." --test "Jina AI"

Real Estate Valuation Estimator

gptdeploy --description "Create a microservice that estimates the value of a property based on factors like location, property type, age, and square footage." --test "Berlin Friedrichshain, Flat, 100m², 10 years old"

Chemical Structure Drawing

gptdeploy --description "Convert a chemical formula into a 2D chemical structure diagram" --test "C6H6"

Gene Sequence Alignment

gptdeploy --description "Align two DNA or RNA sequences using the Needleman-Wunsch algorithm" --test "AGTC, GTCA"

Markdown to HTML Converter

gptdeploy --description "Convert markdown to HTML" --test "# Hello, welcome to GPT Deploy!"

Barcode Generator

gptdeploy --description "Generate a barcode from a string" --test "Hello, welcome to GPT Deploy!"

File Compression

gptdeploy --description "Compress a file using the gzip algorithm" --test "content of the file: Hello, welcome to GPT Deploy!"

Meme Generator

gptdeploy --description "Generate a meme from an image and a caption" --test "Surprised Pikachu: https://media.wired.com/photos/5f87340d114b38fa1f8339f9/master/w_1600%2Cc_limit/Ideas_Surprised_Pikachu_HD.jpg, TOP:When you see GPT Deploy create and deploy a microservice in seconds"

Watermarking Images

gptdeploy --description "Add a watermark (GPT Deploy) to an image" --test "https://images.unsplash.com/photo-1602738328654-51ab2ae6c4ff"

File Metadata Extractor

gptdeploy --description "Extract metadata from a file" --test "https://images.unsplash.com/photo-1602738328654-51ab2ae6c4ff"

Video Thumbnail Extractor

gptdeploy --description "Extract a thumbnail from a video" --test "http://techslides.com/demos/sample-videos/small.mp4"

Gif Maker

gptdeploy --description "Create a gif from a list of images" --test "https://images.unsplash.com/photo-1564725075388-cc8338732289, https://images.unsplash.com/photo-1584555684040-bad07f46a21f, https://images.unsplash.com/photo-1584555613497-9ecf9dd06f68"

Heatmap Generator

gptdeploy --description "Create a heatmap from an image and a list of relative coordinates" --test "[[0.1, 0.2], [0.3, 0.4], [0.5, 0.6], [0.2, 0.1], [0.7, 0.2], [0.4, 0.2]]"

🔮 vision

Use natural language interface to create, deploy and update your microservice infrastructure.

TODO

critical

  • add buttons to README.md
  • fix problem with package installation
  • add more interesting examples to README.md
  • api key in install instruction
  • add instruction about cleanup of deployments
  • add logo

Nice to have

  • hide prompts in normal mode and show them in verbose mode
  • tests
  • clean up duplicate code
  • support popular cloud providers - lambda, cloud run, cloud functions, ...
  • support local docker builds
  • autoscaling enabled for cost saving
  • don't show this message: 🔐 You are logged in to Jina AI as florian.hoenicke (username:auth0-unified-448f11965ce142b6). To log out, use jina auth logout.
  • add more examples to README.md
  • support multiple endpoints - example: todolist microservice with endpoints for adding, deleting, and listing todos
  • support stateful microservices
  • The playground is currently printed twice even if it did not change. Make sure it is only printed twice in case it changed.
  • allow to update your microservice by providing feedback
  • bug: it can happen that the code generation is hanging forever - in this case aboard and redo the generation
  • feat: make playground more stylish by adding attributes like: clean design, beautiful, like it was made by a professional designer, ...

Watch the video

Description
No description provided
Readme 11 MiB
Languages
Python 97.5%
Shell 1.9%
Dockerfile 0.6%