Don’t Build the Thing, Build the Thing that Builds the Thing!
Dev-GPT is a tool that uses LLMs to build custom microservices, replacing the traditional software development process with AI. Just describe a service in natural language and a virtual development team will generate, debug, and deploy it for you.
Once upon a time, in the future
An Introduction to Computer Programming class at Metaverse University. The holographic professor stands before the class in the formal uniform of IT engineers: A ratty AC/DC t-shirt and faded blue jeans, her hair frazzled and tangled in uncombed knots in the style customary among STEM professionals.
She begins her lecture.
“In olden times, a programmer’s day consisted of reading JIRA tickets and then going to Stack Overflow to find code snippets that would do the job specified. This was considered highly skilled work, requiring considerable background knowledge and experience.”
“But in 2023, things changed. Primitive conversational AI began to seep into the job.”
“At first, it wasn’t much more than an error-prone personification of Stack Overflow and dozens of similar programmer forums. A programmer might routinely ask it: I encountered the following error.”
“Then they would control-c/control-v some error message and ask: How do I solve it?”
“The fundamental laziness at the heart of all skilled programming could never abide having to actually press two buttons at the same time and then mouse over to another application, moving data from one window to another, much less tolerate having to do all that typing. So before long, companies started building solutions like GitHub Copilot to bind programmers’ development environments directly to the AI.”
“This was fine for a while, but before long the programmer’s instinct for recursive self-reflection changed the paradigm: They no longer thought of these developments as tools for solving specific problems but as automated factories that generate solutions for whole classes of problems.”
“The focus of software development shifted from building the thing we need, to building the thing that builds the thing we need. The introduction of large language models moved software engineering to a higher level of abstraction.”
“The whole history of programming is a history of rising to higher levels of abstraction, letting software handle more and more of the details. As far back as the 1940s, assembly language abstracted from hand-coded 0’s and 1’s. Early programming languages abstracted from assembly language. Progressively higher-level languages took greater charge of the details that humans previously dealt with directly.”
“But AI did more than just move the programmer one level further up on the ladder of abstraction. It changed our entire understanding of the process of software development.”
What is Dev-GPT?
Jina AI’s Dev-GPT is a tool that uses OpenAI’s GPT-3.5-turbo or GPT-4 to build custom microservices, replacing the traditional software development process with AI automation. You can simply describe a service in natural language and a virtual development team will generate, debug, and deploy it for you.
To do this, Dev-GPT instantiates three AI agents:
- Product Manager: The Product Manager interacts with you to clarify the requirements and make sure even the corner cases are well-defined.
- Developer: The refined requirements are then handed over to the Developer agent, which writes code to implement the microservice, writes test cases, and debugs the code until the tests pass.
- DevOps: Finally, the DevOps agent deploys the microservice and monitors it.
Let’s look at a specific example. Run dev-gpt generate
at the command prompt:
% dev-gpt generate
👩💼👋 Hi, I'm Susana, a PM at Jina AI. Gathering the requirements
for our engineers.
👩💼❓ What should your microservice do?
you:
Susana, your AI project manager asks what you want to build.
So tell her in plain English:
you: Translate English to French
And she answers:
I suggest that we implement the following microservice:
This microservice receives an input text in English and translates it to
French using gpt_3_5_turbo. The input parameters include the "input_text"
which is a string containing the English text to be translated. The output of
the microservice is the "translated_text", a string containing the translated
text in French.
Do you agree? [y/n]
This is your chance to clarify the specs with your project manager. When you are done:
👩💼 👍 Great, I will handover the following requirements to our engineers:
Microservice Description:
This microservice receives an input text in English and translates it to
French using gpt_3_5_turbo. The input parameters include the "input_text"
which is a string containing the English text to be translated. The output of
the microservice is the "translated_text", a string containing the translated
text in French.
Susana then passes this spec to the developers:
Great! I will hand this over to the developers!
The developers will:
- Generate microservice Python code.
- Separately, generate test code from the spec.
- Test the generated code using the test code, and debug if needed.
If you add the --verbose
flag to the command, you will see detailed log information about this process.
Finally, you are given a choice of DevOps:
You can now run or deploy your microservice:
dev-gpt run --path <project path>/microservice
dev-gpt deploy --path <project path>/microservice
The first will run it locally (in a Docker if possible) and the second will deploy to Jina AI Cloud, which requires an account and login.
If you deploy to Jina AI Cloud, your virtual DevOps engineer will eventually respond with something like:
% dev-gpt deploy --path ./microservice
Deploy a jina flow
INFO Successfully submitted flow with ID gptdeploy-c2ba13c314
INFO Check the Flow deployment logs: https://cloud.jina.ai/ !
╭───────────────────────── 🎉 Flow is available!────────────────────────╮
│ │
│ ID gptdeploy-c2ba13c314 │
│ Gateway https://gptdeploy-c2ba13c314.wolf.jina.ai │
│ Dashboard https://cloud.jina.ai/ │
│ │
╰────────────────────────────────────────────────────────────────────────╯
Your Microservice is deployed at https://gptdeploy-c2ba13c314.wolf.jina.ai
and is available at https://gptdeploy-c2ba13c314.wolf.jina.ai/playground
We open now the playground in your browser.
waiting for app to be ready...
You can then use this new microservice via a web interface:
Or interact directly with its REST endpoint:
% curl -X "POST" "<https://gptdeploy-c2ba13c314.wolf.jina.ai/post>"
-H "accept: application/json" -H "Content-Type: application/json"
-d '{"data": [{"text": "{\\"english_text\\": \\"This is not a pipe.\\"}"}]}'
Which returns:
{
"header": { ... },
"parameters": {},
"routes": [ ... ],
"data": [
{
"id": "5a51dfb440e83c532a1cc8f9df4518b7",
... ,
"text": "{\\"french_text\\": \\"Ce n'est pas une pipe.\\"}",
...
}
]
}
Try it out yourself at https://gptdeploy-c2ba13c314.wolf.jina.ai/playground.
Why build the thing that builds the thing?
Why does this represent the future of software development?
The way Dev-GPT uses AI models in programming signals a change of paradigm for software developers. It is a major break from traditional, labor-intensive coding processes. Instead, Dev-GPT deploys the power of the latest large language models to ensure that the microservices generated are robust and efficient.
An AI-driven approach has a lot of benefits over traditional software development:
Cost
With Dev-GPT, the development cost for a microservice can be as low as 4 to 20 cents, depending on the AI model, the number of calls to it, and the cost per call. This makes possible the development of large numbers of diverse microservices for a fraction of the cost of hiring a team to develop even one.
Speed
Building the "thing that builds the thing" also saves time. Rather than spending hours to weeks writing, testing, and debugging code, Dev-GPT generates microservices in minutes. Companies can bring new services online quickly in response to new needs and market changes.
Simplicity
Dev-GPT simplifies development by taking care of everything from conception to deployment. No more tickets and scrums!
Promoting creativity
Dev-GPT frees engineering staff and technical managers to focus on more complex, strategic questions that demand creativity. Removing the grunt work from the development process moves the focus from getting things done to what can and should be done? It creates greater space for imagination and innovation.
Examples
It is up to you to decide what you want to build. You can let your creativity run free. Here are some examples to inspire you and give you a feeling of what is possible:
Rainbow Tweet 🌈
Do you know someone who gets irrationally angry about pineapple on pizza?
Are you sick of vitriolic Internet debates over minutiae?
Do you just not care what angry little pearl of wisdom has made someone the main character on Twitter this week?
That’s why I used Dev-GPT to build Rainbow Tweet. It's a Chrome extension that turns negative speech into fluffy rainbow speech, showing how easy it is to bring creative applications to life using Dev-GPT.
Here is the prompt I used to create the backend for the plugin:
Input is a tweet that contains passive-aggressive language. The output is the
positive version of that tweet.
And here is the result:
Chemical Structure Diagram
dev-gpt generate \\
--description "Convert a chemical formula into a 2D chemical structure diagram. Example inputs: C=C, CN=C=O, CCC(=O)O" \\
--model gpt-4
Word Cloud Generator
dev-gpt generate \\
--description "Generate a word cloud from a given text" \\
--model gpt-4
Audio to Mel Spectrogram
Mel spectrograms are frequency spectrograms that use the mel scale.
dev-gpt generate \\
--description "Create mel spectrogram from audio file. Example: <https://cdn.pixabay.com/download/audio/2023/02/28/audio_550d815fa5.mp3>" \\
--model gpt-4
Back to the Future
The professor wraps up her Introduction to Computer Programming class at Metaverse University. Much of the class is visibly paying her no attention.
“In the aftermath of Dev-GPT and its descendants, programming became increasingly a question of nudging and cajoling large language models to correctly understand the desired outcome. This why today most of you, the programmers of tomorrow, have come to this field with previous experience as physical trainers, coaches for sports teams, theatre directors, and elementary school teachers. Your capacity to get stubborn people to do things transfers to getting AI models to do them.”
She looks over the class, knowing only half of them were listening at best, and then dismisses them with a gesture before her hologram flickers away, momentarily replaced by a stylized image of birds carrying a whale before disappearing entirely.
Get started with Dev-GPT
To get started with Dev-GPT, just install the package:
pip install dev-gpt
Then start generating:
dev-gpt generate --description "<description of the microservice>"
And get in touch with the Dev-GPT community on Discord.