AI & Node.js

Create intelligent, efficient, and user-friendly experiences by integrating AI into JavaScript applications

Try Node.js in the sandbox Red Hat & Node.js

/sites/default/files/NodeJS-Edge-Hero-Banner_NodeJs.png

Why Node.js with AI?

AI and Large Language Models (LLMs) are becoming increasingly important tools for web applications. As a JavaScript/Node.js developer, it's crucial to understand how to integrate them into your projects. While Python is often considered the go-to language for AI and model development, this doesn't mean that all application development will shift to Python. Instead, the tools and languages best suited for each part of an application will continue to be chosen, and these components will be integrated to create the overall solution.

 

For JavaScript/Node.js developers, this means understanding how to make requests to a running model. Until recently, this typically involved making HTTPS calls to a bespoke service, depending on the AI service or product your company used. However, as the field matures, libraries are emerging that abstract the model endpoints and simplify the implementation of common flows. Some interesting libraries that support JavaScript/TypeScript include Langchain.js and LlamaIndexTS, with the list growing rapidly.

 

One of the key advantages of using these libraries is their ability to easily switch between accessing a model locally, using a cloud service like OpenAI, or using a model hosted by your organization running in OpenShift AI. This flexibility is important because it allows you to change how your application accesses models without being locked into a specific vendor. It also facilitates experimentation while ensuring that deployments use models in a way that protects proprietary information.

Learn more about how Red Hat can help your AI Applications

Red Hat OpenShift AI

Red Hat OpenShift AI

Red Hat® OpenShift® AI is a flexible, scalable MLOps platform with tools to build, deploy, and manage AI-enabled applications. Built using open-source technologies, it provides trusted, operationally consistent capabilities for teams to experiment, serve models, and deliver innovative apps.

Get OpenShift AI 

Integrated Hybrid Cloud

Integrated Hybrid Cloud MLOps and Application Platform

Red Hat’s integrated hybrid cloud AI/ML platform provides a consistent way to support the end-to-end lifecycle of both ML Models and cloud-native applications in terms of how they are developed, packaged, deployed, and managed. 

Learn More 

Get started

LLM Node.js learning path feature image

Getting started with large language models and Node.js

40 minutes: Intermediate

Take an initial journey using Node.js and Langchain.js to run queries against a model with retrieval-augmented generation (RAG) using a model running locally, with OpenAI and a model running in OpenShift AI.

Start 

Diving Deeper with large language models and Node.js

Diving Deeper with large language models and Node.js

40 minutes: Intermediate

In this learning path we dig deeper into using large language models (LLMs) with Node.js by looking at Ollama, LlamaIndex, function calling, agents and observability with Open Telemetry.

Start 

LLM Node.js learning path feature image

A quick look at large language models with Node.js, Podman Desktop, and the Granite model

Explore large language models (LLMs) by trying out the Granite model on Podman AI Lab.

Start 

Node.js applications to OpenShift AI image

Deploying your LangChain.js Node.js applications to OpenShift AI

1 hour: Intermediate

In this learning exercise we will deploy an existing Node.js application based on LangChain.js to OpenShift and demonstrate how easy it is to switch between local, cloud and Openshift.ai based model serving.

Start 

RAG) with Node.js to optimize your AI applications image

Utilize Retrieval-Augmented Generation (RAG) with Node.js to optimize your AI applications

20 minutes: Intermediate

In this learning exercise we will use Retrieval Augmented Generation (RAG) with a Node.js application in order to optimize an AI application. 

Start 

Featured image for Node.js.

A quick look at tool use/function calling with Node.js and Ollama

40 minutes: Intermediate

Ollama recently announced tool support and like many popular libraries for using AI and large language models (LLMs) Ollama provides a JavaScript API along with its Python API.

Start