Use natural language interface to create, deploy and update your microservice infrastructure.
Project description
GPT Deploy: One line to create them all 🧙🚀
Turn your natural language descriptions into fully functional, deployed microservices with a single command! Your imagination is the limit!
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 microservice accurately aligns with your intended task a test scenario is required.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 create --description "Given a PDF, return it's text" --test "https://www.africau.edu/images/default/sample.pdf"
To create your personal microservice two things are required:
- A
description
of the task you want to accomplish. - A
test
scenario that ensures the microservice works as expected.
The creation process should take between 5 and 15 minutes. During this time, GPT iteratively builds your microservice until it finds a strategy that make you test scenario pass. Once the microservice is created and deployed, you can test it using the generated Streamlit playground.
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]
- GPT Deploy identifies several strategies to implement your task.
- It tests each strategy until it finds one that works.
- 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.
- 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.
- 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.
- If it fails 10 times in a row, it moves on to the next approach.
Examples
Meme Generator
gptdeploy create --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 discovered GPTDeploy"
Rhyme Generator
gptdeploy create --description "Given a word, return a list of rhyming words using the datamuse api" --test "hello"
3d model info
gptdeploy create --description "Given a 3d object, return vertex count and face count" --test "https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/models/wolf.obj"
Table extraction
--description "Given a URL, extract all tables as csv" --test "http://www.ins.tn/statistiques/90"
Audio to mel spectrogram
gptdeploy create --description "Create mel spectrograms from audio file" --test "https://cdn.pixabay.com/download/audio/2023/02/28/audio_550d815fa5.mp3"
Text to speech
gptdeploy create --description "Convert text to speech" --test "Hello, welcome to GPT Deploy!"
Your browser does not support the audio element.
Heatmap Generator
gptdeploy create --description "Create a heatmap from an image and a list of relative coordinates" --test "https://images.unsplash.com/photo-1574786198875-49f5d09fe2d2, [[0.1, 0.2], [0.3, 0.4], [0.5, 0.6], [0.2, 0.1], [0.7, 0.2], [0.4, 0.2]]"
QR Code Generator
gptdeploy create --description "Generate QR code from URL" --test "https://www.example.com"
🔮 vision
Use natural language interface to create, deploy and update your microservice infrastructure.
✨ Contributers
If you want to contribute to this project, feel free to open a PR or an issue. In the following, you can find a list of things that need to be done.
Critical:
- fix problem with package installation
- add instruction about cleanup of deployments
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, ...
- support for other large language models like ChatGLM
- for cost savings, it should be possible to insert less context during the code generation of the main functionality - no jina knowledge is required
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.