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.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.
Your api key must have access to gpt-4 to use this tool.
We are working on a way to use gpt-3.5-turbo as well.
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 your test scenario pass. Once the microservice is created and deployed, you can test it using the generated Streamlit playground. The deployment is made on the Jina`s infrastructure. When creating a Jina account, you get some free credits, which you can use to deploy your microservice ($0.025/hour). If you run out of credits, you can purchase more.
To save credits you can delete your microservice via the following commands:
jc list # get the microservice id
jc delete <microservice id>
The graphic below illustrates the process of creating a microservice and deploying it to the cloud elaboration two different implementation strategies.
graph TB
description[description: generate QR code from URL] --> make_strat{think a}
test[test: https://www.example.com] --> make_strat[generate strategies]
make_strat --> implement1[implement strategy 1]
implement1 --> build1{build image}
build1 -->|error message| implement1
build1 -->|failed 10 times| implement2[implement strategy 2]
build1 -->|success| registry[push docker image to registry]
implement2 --> build2{build image}
build2 -->|error message| implement2
build2 -->|failed 10 times| all_failed[all strategies failed]
build2 -->|success| registry[push docker image to registry]
registry --> deploy[deploy microservice]
deploy --> streamlit[create streamlit playground]
streamlit --> user_run[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.
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"
gptdeploy create --description "Given a word, return a list of rhyming words using the datamuse api" --test "hello"
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"
--description "Given a URL, extract all tables as csv" --test "http://www.ins.tn/statistiques/90"
gptdeploy create --description "Create mel spectrograms from audio file" --test "https://cdn.pixabay.com/download/audio/2023/02/28/audio_550d815fa5.mp3"
gptdeploy create --description "Convert text to speech" --test "Hello, welcome to GPT Deploy!"