bitcoin
bitcoin

$100157.197162 USD

-2.21%

ethereum
ethereum

$3109.959445 USD

-5.70%

xrp
xrp

$2.903259 USD

-4.75%

tether
tether

$0.999847 USD

0.01%

solana
solana

$212.786145 USD

-8.07%

bnb
bnb

$656.277331 USD

-2.87%

usd-coin
usd-coin

$1.000046 USD

0.01%

dogecoin
dogecoin

$0.302299 USD

-7.83%

cardano
cardano

$0.890148 USD

-5.84%

tron
tron

$0.242313 USD

-5.43%

chainlink
chainlink

$22.668207 USD

-11.00%

avalanche
avalanche

$31.325536 USD

-9.47%

stellar
stellar

$0.389588 USD

-6.43%

sui
sui

$3.736378 USD

-7.94%

toncoin
toncoin

$4.589423 USD

-6.21%

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 Feb 03, 2025