SkillAgentSearch skills...

SageMaker

Examples for using AI21's models through Amazon SageMaker

Install / Use

/learn @AI21Labs/SageMaker
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Deploy AI21 Labs Language Models on AWS SageMaker

Examples for using Jurassic-2 models through Amazon SageMaker.

Installation

You can install the package using pip:

pip install -U "ai21[AWS]"

And then import the package:

import ai21

Quickstart

In order to use this library, you must configure your AWS credentials.

All set up? Make your first interaction with Jurassic-2:

response = ai21.Completion.execute(destination=ai21.SageMakerDestination("j2-ultra"),
                                   prompt="To be, or",
                                   maxTokens=4,
                                   temperature=0)

print(response['completions'][0]['data']['text'])
# not to be: that is the question

For more comprehensive quickstart guides, see:

Foundation models

Jurassic-2 Ultra

Jurassic-2 Mid Instruct

Jurassic-2 Light

Task-specific models

AI21 Summarize

AI21 Contextual Answers

AI21 Paraphrase

AI21 Grammatical Error Correction (GEC)

Learn more

Related Skills

View on GitHub
GitHub Stars32
CategoryDevelopment
Updated1y ago
Forks16

Languages

Jupyter Notebook

Security Score

60/100

Audited on Mar 13, 2025

No findings