Diving Deeper with large language models and Node.js

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.

OpenShift.ai

Overview: Diving Deeper with large language models and Node.js

AI and Large Language Models (LLMs) are growing as an important tool for Web applications.  As a JavaScript/Node.js developer it's important to understand how to fit into this growing space.

This learning path is a follow on to How to get started with large language models and Node.js. If you have not already gone through How to get started with large language models and Node.js you might want to do that first, but it's not strictly necessary. In the first learning path we looked at Langchain.js and Retrieval Augmented Generation (RAG), as well as easily switching your Node.js application to accessing an LLM running under Openshift.ai.

In order to avoid playing favorites, in this learning path we will dive into  OllamaLLamaIndex, function calling as well as observability with Open Telemetry. All with a focus of using them with Javascript/Node.js. Just like LangchainOllama and LLamaIndex support TypeScript/Javascript as their second language after python.

Prerequisites to run the examples:

  • A GitHub account.
  • A Git client
  • Node.js 18.x or later
  • A linux, windows or MacOS computer, optionally with GPU support
  • Optionally,  access to a OpenShift cluster if you want to try out Open Telemetry tracing with LLamaIndex. You can easily read along instead in the last lesson where we cover that if you don’t want to set up an OpenShift cluster and install Open Telemetry.

In this learning path, you will:

  • Learn about Ollama 
  • Learn about LLamaIndex.ts and run a Node.js program that makes some requests to an LLM  running with Ollama 
  • Run a Node.js application that demonstrates the use of Function calling /Tool use by a LLM both with and without using an agent
  • Generate traces from a Node.js program built with LLamaIndex.ts, and capture those traces with Open Telemetry and view them in a Jaeger front end all running under OpenShift.

It is important to note that while this learning path is written to allow you to follow along and run the examples, this is not necessary to follow the learning path. The explanation and walkthrough for each lesson includes the output of running the examples so you can just follow along without installing or configuring anything. This might not be quite as fun as running the examples yourself but you will still learn the core information covered in the learning path.