Skip to main content

GenAI in Vocareum Notebook

Enable AI resources in an assignment to access advanced teaching and learning tools

M
Written by Mary Gordanier
Updated over a week ago

For Teachers and Admins

You have GenAI resources like OpenAI or Claude, but you want to know how to evenly distribute them in a controlled environment for your class. This article will cover step-by-step how to create a Vocareum AI Notebook and leverage your GenAI resources to empower learners.

Use Cases

There are two primary ways you can use AI within a Vocareum assignment:

  1. Give students access to AI tutors and learning tools to support their work in any subject.

  2. Provide students who are learning about AI engineering or machine learning with access to budgeted GenAI API keys that they can use directly in their code.

In both cases, the first step is to confirm your course has access to GenAI resources.

Availability

Before you can use GenAI resources in an assignment, they must first be configured on the Organizational level and enabled for your course by an Admin of your institution. More information on the setup process can be found in the GenAI Gateway guide.

To check whether your course has access to GenAI, visit the Course Settings page. Under Course Resources, GenAI will be listed if it has been enabled for your course.

Your organization's Admins may also set a course-level overall budget for GenAI and determine which AI models are available.

Lab Types

The following lab types support GenAI API Key Generation:

AI-enabled learning tools are only available in Vocareum Notebook assignments.

Vocareum GenAI API Keys

GenAI API keys validate that a user has permission to access an AI service.

Once GenAI is enabled for a Vocareum assignment, each user receives a GenAI API key in their lab environment. The key can be used for AI-enabled learning tools, or it can be copied by students for direct use in their code.

Vocareum GenAI API keys work exclusively through the Vocareum AI Gateway, which:

  1. Records and validates requests (key expiration, budget limits)

  2. Adds appropriate context (custom prompts, etc.)

  3. Routes requests to AI services using organization-level API keys

  4. Records and returns responses

A single user key can provide access to multiple language models across services like OpenAI, Anthropic, Gemini, Azure, AWS Bedrock, or custom LLM deployments.

In Vocareum Notebook labs, users can click the AI icon in the left-side lab menu to access their key and corresponding API base URL, view the available AI models, and track their budget spend.

Environment Variables

When GenAI API Key generation is enabled for an assignment part, environment variables for all available API keys and endpoints are pre-populated in the student work area.

For example, running this Python code in a file within Vocareum Notebook will access the OpenAI API key and base URL environment variables and save them for local use:

import os

openai_api_key = os.environ["OPENAI_API_KEY"]
openai_base_url = os.environ["OPENAI_BASE_URL"]

Full list of environment variables by GenAI service

OpenAI

OPENAI_API_KEY
OPENAI_BASE_URL
OPENAI_API_BASE

Note: Two environment variables are set for OpenAI's base URL to support older Python package versions.

Azure

AZURE_OPENAI_API_KEY
AZURE_OPENAI_ENDPOINT

Llama

LLAMA_API_KEY
LLAMA_BASE_URL

Custom

GENAI_API_KEY
GENAI_BASE_URL

Claude

ANTHROPIC_API_KEY
ANTHROPIC_BASE_URL

Claude Bedrock

ANTHROPIC_API_KEY
ANTHROPIC_BASE_URL

Gemini

GOOGLE_API_KEY
GOOGLE_GEMINI_BASE_URL

Nova

NOVA_API_KEY
NOVA_BASE_URL

Keys in Configure Workspace

The Configure Workspace environment is available to admins and teachers for each assignment part. It is primarily used to edit assignment content.

To access it, navigate to the Edit Assignments page for the course, open an assignment, and click the Configure Workspace button for a part:

When GenAI API key generation is enabled for a course, users in the Configure Workspace environment have access to a GenAI key. This key is not restricted by the budget set at the assignment part level. Instead, the key's budget is based on the overall GenAI budget limit set by an Organization Admin for the course.

Note that the GenAI environment variables described in this article are not pre-populated in the Configure Workspace environment, unlike in student work areas. Users in Configure Workspace can view their API key and base URL in the GenAI Details panel in Vocareum Notebook.

AI-Enabled Learning Tools

Once GenAI API Key Generation is enabled for a Vocareum Notebook assignment, teachers and admins can turn on any of the following learning tools:

AI Assistants

Vocareum AI Assistants are customizable GenAI chatbots. They can be used to give students access to large language models for prompt engineering practice or to create a custom AI Tutor tailored to the needs of your curriculum.

When it is enabled, students can click the AI Assistant option in the left-side lab menu

If a customized AI Assistant is shared with your course, it will be available to students in any assignment part where you turn on the AI Assistant setting.

If no customized AI Assistants are shared with a course and you turn on the AI Assistant part setting, the assignment will include a default assistant. In this case, students can select the model they would like to use in the chatbot application from the options available for their assignment.

To change the model or custom assistant you are currently using within a Vocareum Notebook lab:

  1. Click the gear icon in the upper left corner of the Assistants panel

  2. Select the model and/or assistant you would like to use from the provided dropdown menus.

If there is only one model or assistant option available within the assignment, then the corresponding dropdown menu(s) will be hidden.

AI-Assisted Cells

When you enable AI-Assisted Cells for a Vocareum Notebook assignment part, a button with a question mark icon will appear in the upper right corner of each cell of your Jupyter Notebook (.ipynb) files. This is the Get Help button. When clicked, an AI agent will provide guidance and suggestions to the user based on the context of the current and surrounding cells.

Co-Pilot

When you enable Co-Pilot for a Vocareum Notebook assignment part, a button with a wand icon will appear in the upper right corner of each cell of your Jupyter Notebook (.ipynb) files. This is the Co-Pilot button. When clicked, it opens a modal where the user can enter a prompt to generate code or modify the existing code in the cell. The Co-Pilot AI agent will use the context of the current and surrounding cells to inform its response.

Forum

Enabling the Forum option in an assignment's GenAI settings adds a discussion forum to Vocareum Notebook where students and their teachers can discuss responses provided by the AI Assistant or Get Help agent.

To use the Forum:

  1. Open the Assistants panel from the Vocareum Notebook sidebar.

  2. Ask a question of the AI Assistant.

  3. Click the link to "Create forum thread" at the end of the AI Assistant's response.

  4. Enter a comment or question related to your interaction with the AI Assistant.

  5. Students and Teachers can visit the Forum panel in their lab to view and reply to forum threads.

How to Enable GenAI in Assignments

  1. Within your course, navigate to the Edit Assignments page.

  2. Create a new assignment or select an existing one.

  3. Click on the name of the assignment part to open the Part Settings.

  4. In the Part Settings, open the Resources section.

  5. Toggle on 'Enable GenAI API Key Generation' to activate GenAI features in your assignment.

  6. Select a GenAI Policy for the assignment

    1. Use the GenAI Policy dropdown to select a policy, which will determine which AI services and models are available within the assignment.

    2. If an Organization Admin has pre-set a policy for the course, the GenAI Policy dropdown will show the selected policy, and teachers will not be able to edit it.

  7. Set the Total Allowance Budget, which will impose an upper limit on the amount each student user can spend on GenAI resources for this assignment. This field supports both whole numbers and decimals.

  8. Optionally, you may also toggle on any of the following AI learning features (described in more detail in the AI Features section):

    1. AI Assistant

    2. Co-Pilot

    3. AI-Assisted Cells

    4. Forum

Did this answer your question?