DEV Community

Marcos Henrique for AWS Community Builders

Posted on

4

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.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (1)

Collapse
 
kiryl_anoshka profile image
Kiryl Anoshka

Interestig!

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay