bitcoin
bitcoin

$61769.147764 USD

-2.81%

ethereum
ethereum

$1743.384989 USD

-3.33%

tether
tether

$0.999069 USD

0.02%

bnb
bnb

$571.804060 USD

-2.80%

usd-coin
usd-coin

$0.999854 USD

0.00%

xrp
xrp

$0.966271 USD

-1.46%

solana
solana

$72.584973 USD

-3.00%

tron
tron

$0.309764 USD

-0.92%

hyperliquid
hyperliquid

$65.747085 USD

-3.44%

zcash
zcash

$851.603224 USD

-9.10%

dogecoin
dogecoin

$0.057499 USD

-3.10%

monero
monero

$477.774191 USD

-4.85%

unus-sed-leo
unus-sed-leo

$9.211262 USD

-1.40%

chainlink
chainlink

$8.864427 USD

-3.12%

cardano
cardano

$0.149815 USD

-2.47%

Cryptocurrency News Video

ChatGPT + Node.js | 3 Ways to Overcome the Token Limits

May 14, 2024 at 07:27 am Bret Cameron

Learn how to use the OpenAI API in Node.js and exceed the token limits.

You can find a repository containing everything in this tutorial here: https://github.com/BretCameron/nodejs-openai-memory-system-tutorial/

⏰ Timestamps
00:00 - Intro
00:58 - Project Setup
02:53 - Creating an OpenAI Client
04:01 - Getting Credentials
05:22 - Creating a Basic Conversation with GPT-4
11:25 - Why Token Limits Can Be a Problem
13:00 - Strategy 1: Rolling Context
17:03 - Strategy 2: Summarise Message History
24:03 - Strategy 3: Split into Excerpts by Topic
39:16 - Bonus Tip: Using the Debugger in VSCode
40:50 - Outro

? Description
Right now, it's possible to harness the power of LLMs (large language models) through several public APIs - giving us access to the likes of ChatGPT, Claude and Gemini for use in our own applications.

At a small scale, using these APIs is straightforward. But if we want to support longer conversations or larger amounts of context, sooner or later we will bump into token limits and we'll need to implement our own workarounds.

In this video, I'll walk you through three strategies for overcoming these token limits, so that you can support much longer conversations or much more context - or both!

We'll be using OpenAI's API in Node.js, but the strategies we'll learn can be adapted to pretty-much every mainstream LLM in any server-side programming language.

#nodejs #openai #ai #llm #machinelearning #javascript #typescript

? Article
For a written version of this tutorial, check out my article on Medium: https://medium.com/@bretcameron/3-strategies-to-overcome-openai-token-limits-d60df946f93c

? Links
• Repository: https://github.com/BretCameron/nodejs-openai-memory-system-tutorial/

For those that want to go deeper I recommend this article on memory systems for LLMs by Langchain: https://python.langchain.com/v0.1/docs/modules/memory/
Video source:Youtube

Disclaimer:info@kdj.com

The information provided is not trading advice. kdj.com does not assume any responsibility for any investments made based on the information provided in this article. Cryptocurrencies are highly volatile and it is highly recommended that you invest with caution after thorough research!

If you believe that the content used on this website infringes your copyright, please contact us immediately (info@kdj.com) and we will delete it promptly.

Other videos published on Nov 20, 2026