Configuring Bedrock as your LLM with llamindex-TS

llamindex for TypeScript is in its early stages compared to the Python version. Still, it already offers great flexibility if you don’t want to change the language of your Proof of Concept or your project (honestly, I haven’t made anything production-ready yet, so DYR).

You will need to use the package @llamaindex/community because natively, we can’t use Bedrock in the llamindex core package, so for this purpose, install @llamaindex/community, it is a package managed by the llamaindex team.
Basically, it’s a secondary distribution as it seems to be a way to externalise the open-source contribution (dunno why, but ok)

Cut to the chase

bouncing head man

import { BEDROCK_MODELS, Bedrock } from '@llamaindex/community' Settings.llm = new Bedrock({ model: BEDROCK_MODELS.ANTHROPIC_CLAUDE_3_HAIKU, })
Enter fullscreen mode Exit fullscreen mode

I discovered this handy tip while reviewing a pull request’s readme. It took some effort to figure it out, so I hope it’s helpful to you.


Discover more from Coursity

Subscribe to get the latest posts sent to your email.

Leave a Comment

Your email address will not be published. Required fields are marked *

Discover more from Coursity

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top
Quick setup dedicated servers (tbd). Chinese, continental, indian foods.