Picking the stack - Navigating JavaScript and Python

Project Source Code

Get the project source code below, and follow along with the lesson material.

Download Project Source Code

To set up the project on your local machine, please follow the directions provided in the README.md file. If you run into any issues with running the project source code, then feel free to reach out to the author in the course's Discord channel.

Previous LessonIntroduction to AI Product DevelopmentNext LessonDesigning a Hybrid Web Application Architecture with JavaScript and Python
  • |

Lesson Transcript

  • [00:00 - 00:09] Welcome back. In this lesson, we will pick our stack. Picking the right tool for the job can make or break the success of a project.

  • [00:10 - 00:20] Very often, we are not the first to attack a given problem. We can reuse libraries, we can find some help on the website like Stack Over flow or GitHub.

  • [00:21 - 00:29] We can reuse some cut samples. Now, when we think about the build an AI product, two stacks come to mind.

  • [00:30 - 00:41] The first is JavaScript. The second is Python. Why JavaScript? Let's look at the numbers. Here you can see this chart, this carabiner playing site language usage.

  • [00:42 - 00:53] And this blue line at 98.9% is JavaScript. Complete another domination. Why is that? Because JavaScript is the language of the browser.

  • [00:54 - 01:03] There is another language that comes to mind in this Python. If you are interested in data science or in machine learning, you know that Python is king.

  • [01:04 - 01:16] And here, let's look at the number. Here we are looking at the survey of machine learning competition. And what we see is that more than 95% of winning solution were in Python.

  • [01:17 - 01:25] All the margin of frameworks for machine learning, all the great libraries are in Python. Now, we have to make a choice or not.

  • [01:26 - 01:34] We'll see later how we could combine both stacks. But for a moment, let's focus on the monostag implementation.

  • [01:35 - 01:43] And we'll see how we could make an AI product with only JavaScript or only Python. So let's start with a pure JavaScript implementation.

  • [01:44 - 02:03] So first, I want to show you the virtual products solution. Virtual is a very innovative company who made the next GIS framework, which is a meta framework, above the React's library. Here we are on NPM, which is the package repository for the JavaScript ecosystem.

  • [02:04 - 02:15] And here we can see the library. The library is called AI. You can then state like any other library. You do NPM install AI or any package manager you like.

  • [02:16 - 02:27] And now you can use it. Let me show you how to find some code snippet to get started quickly. We are into a virtual AI playground where we can compare some models.

  • [02:28 - 02:36] You have open the IGBT and meta-lama. So I can ask you some questions and I get them. But what's most interesting is this button.

  • [02:37 - 02:49] Here you can see get code template for this model. You click. And what do you see? Some cut snippets on how to use the AI as the care package to implement this chart.

  • [02:50 - 03:00] Here we have a front end, which is implemented using the AI library. Here we have a backend, which is implemented using the AI library too.

  • [03:01 - 03:11] And you just need to click on copy to clipboard and you're good to go. You can copy paste on our project with an XGS application. And we have coded a chart.

  • [03:12 - 03:23] If you're interested in a whole starter, we go to the versatile website then to template. And we get a starter project with a chatbot.

  • [03:24 - 03:34] You can see it's a chatbot with tools and an generative UI. You just need to click on deep glow in the template and you may use it as a starter for your art project.

  • [03:35 - 03:42] And in a few minutes, you have a ready solution to iterate. So that was the full-time script solution.

  • [03:43 - 03:50] Now, let's say we want to work in Python. We want to do everything in Python, but to do it.

  • [03:51 - 03:59] We have Gradue on StreamNET, which are very similar libraries. We'll focus on Gradue. So Gradue is a Python package.

  • [04:00 - 04:08] You can ask that it has any Python package. And then you just write a few lines of code in Python and you get a UI.

  • [04:09 - 04:16] So here you can see the code. And here is the UI. So this is StreamNET. It's competitor. It's more or less the assemblage.

  • [04:17 - 04:24] And now we have a Gradue background. You can see all the components, Python code and some UI on the right.

  • [04:25 - 04:33] And lastly, we will see a starter project using Gradue. It's open source. You can find it on my ugly face repository.

  • [04:34 - 04:40] It's Louisa NAS/Anything question and sharing. It's a starter project for questions and sharing.

  • [04:41 - 04:50] Using Gradue, you can go find the code, clone the project and you'll get the starter in Gradue. Now, how do you pick and show you pick?

  • [04:51 - 04:57] You should be the one deciding based on your needs. But let's study a quick decision.

  • [04:58 - 05:09] First is how much time do you have? How much resources do you have? The idea is you have unlimited time and if you have a lot of developers, if you have many profiles, then you shouldn't pick one or another.

  • [05:10 - 05:16] You should pick both. Because if you want the best UI you need to write script, if you want the best machine learning, you need Python.

  • [05:17 - 05:27] So this is the best of both worlds that we'll see later. Let's assume you are short of time. You are in a caton or you have to build a park in a few hours.

  • [05:28 - 05:34] Then you have to go on a monostag implementation. Then you need to choose what's most important for you.

  • [05:35 - 05:41] Do you want a beautiful, but you are sacrificing a bit of power on the AI part? Then let's go for the rest.

  • [05:42 - 05:52] Are you a data scientist or an engineering focused on the pure AI implementation? And you are willing to sacrifice a bit on the interface?

  • [05:53 - 05:57] Then you can go on Python. Now we've done a quick exploration in our stack.

  • [05:58 - 06:08] And how I told you, the perfect solution is to combine JavaScript and Python and we look how to do it in the next lesson. See you soon.