Skip to content
24 changes: 15 additions & 9 deletions docs/api/aider.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Aider
You can follow these instructions to use your AI-VERDE API Key after Aider, self-described "AI pair programming in your terminal". More information on installing and using Aider can be found here, https://aider.chat.
You can follow these instructions to use your AI-VERDE API Key after Aider, self-described "AI pair programming in your terminal". More information on installing and using Aider can be found here, [Aider website](https://aider.chat).

## Prerequisites
1. Obtain your AI-VERDE API Key. Instructions can be found here, https://aiverde-docs.cyverse.ai/api/api-token/.
2. Note the model(s) you want to configure for Claude Code. Instructions can be found here, https://aiverde-docs.cyverse.ai/api/api-key-models/.
3. Install Aider. Instructions can be found here, https://aider.chat/#getting-started.
4. The remaining instructions assume you have an open terminal on a Linux system with Aider.
1. **AI-VERDE API Key**
- Obtain your key by following the [API Token guide](https://aiverde-docs.cyverse.ai/api/api-token/).
2. **Model Information**
- Identify the model(s) you plan to use by reviewing the [AI-VERDE Model Documentation](https://aiverde-docs.cyverse.ai/api/api-key-models/).
3. **Install Aider**
- Follow the official [Aider installation instructions](https://aider.chat/#getting-started/).
4. **Terminal Access**
- These instructions assume you have a terminal open on a Linux system with Aider installed.

## 1. Configuring Aider

Expand All @@ -16,10 +20,13 @@ openai-api-base: https://llm-api.cyverse.ai/v1
model: openai/insert-default-model
```
2. Replace `insert-your-aiverde-api-key` with AI-VERDE API Key.
3. Replace the text `insert-default-model` with the AI-VERDE model. For example, to use `phi4`, the model field would be set to `openai/phi4` or if you were using `nrp/phi4` model, the model field would be set to `openai/nrp/phi4`.
3. Replace the text `insert-default-model` with the AI-VERDE model.
Example how the model feild would be set:
- For the phi4 model → model: openai/phi4
- For the nrp/phi4 model → model: openai/nrp/phi4

!!! Note
This is the minimal configuration needed to use Aider. If you want to set other configuration for any models, you add a `$HOME/.aider.model.metadata.json` file. Instructions on the configuration values that can be set in this file can be found here, https://aider.chat/docs/config/adv-model-settings.html.
This is the minimal configuration needed to connect Aider. If you want to set other configuration for any models, you add a `$HOME/.aider.model.metadata.json` file. Instructions on the configuration values that can be set in this file can be found at [aider model settings](https://aider.chat/docs/config/adv-model-settings.html).

## 2. Running Aider
Run Aider with the following command:
Expand All @@ -31,5 +38,4 @@ aider
!!! Note
You may get additional prompts if you're not in a git repo and if you have not configured your model further (see note above). You can also run aider with `aider --no-show-model-warnings` if you prefer to ignore model warnings

If you are successful entering Aider, congratulations!

If you are successful entering Aider, congratulations!
21 changes: 12 additions & 9 deletions docs/api/api-key-claude.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Claude Code (using Anthropic Models)

You can follow these instructions to use your VERDE API Key after installing Claude Code. More information on using Claude Code can be found here, https://docs.anthropic.com/en/docs/intro.
This guide explains how to connect Claude Code with your AI-VERDE API Key to access Anthropic models through CyVerse.

Follow the steps below after installing Claude Code to configure your connection. For more details on Claude Code features and usage, visit the [Anthropic documentation](https://docs.anthropic.com/en/docs/intro).

!!! Note

These instructions assume you are using a space that is connected to Anthropic models. If you need access to Claude Code using a non-Anthropic model, then use the instructions for Claude Code Router.
Use this setup if your workspace supports **Anthropic LLMs** (like Claude 3 Sonnet or Opus). If your workspace uses **non-Anthropic models** (such as OpenAI, Gemini, or other providers), follow the [Claude Code Router setup](claude-code-router.md).

## Prerequisites

1. Your VERDE course or team must be configured to use Anthropic models (see instructor or team lead)
2. Obtain your VERDE API Key. [Instructions can be found here](api-token.md)
3. Install Claude Code. Instructions can be found here, https://www.anthropic.com/claude-code/
4. The remaining instructions assume you have an open terminal on system with Claude Code and bash installed.
1. Your VERDE course or team must be configured to use Anthropic models (see instructor or team lead)
2. Obtain your VERDE API Key follow the [AI-VERDE API Token Guide](api-token.md)
3. Install Claude Code. Instructions can be found here, [Anthropic’s website](https://www.anthropic.com/claude-code/).
4. A terminal (bash) open on a system where Claude Code is installed.

## 1. Setting up the necessary environment variables

Expand All @@ -23,11 +25,12 @@ export ANTHROPIC_BASE_URL="https://llm-api.cyverse.ai"
export ANTHROPIC_API_KEY="insert-VERDE-API-Key-here"
export ANTHROPIC_MODEL="anthropic/claude-sonnet-4"
```
Note, the `ANTHROPIC_MODEL` can be set to any available Anthropic model. Information about available models can be found here, https://docs.anthropic.com/en/docs/about-claude/models/overview

## 2. Start Claude Code
Note, the `ANTHROPIC_MODEL` can be set to any available Anthropic model. Information about available models can be found here, [Anthropic documentation](https://docs.anthropic.com/en/docs/about-claude/models/overview).

## 2. Launch Claude Code

You can then run Claude Code.
After setting your environment variables, start Claude Code by entering:
```
claude
```
Expand Down
65 changes: 43 additions & 22 deletions docs/api/api-key-models.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,58 @@
# Getting a List of Models

There are three ways to obtain a list models:
This page explains how to find which AI models are available to you in **AI-VERDE**.
You can view your models directly in the application or through a simple command-line request using your API Key.

1. Go to [this page](../models-current.md) to view the list of CyVerse models. This list does not include models from external inference services e.g., Jetstream2.
2. Viewing your models in the Course Details
3. Using your API Key to view your models
## Ways to View Available Models

## Viewing your models in the Course Details
1. **From the Models Page** – Visit [this page](../models-current.md) to see the list of CyVerse models.
> *Note:* This list only includes CyVerse-hosted models. External models (e.g., Jetstream2) are not shown.

Your available models will be visible in the AI-VERDE application. These are the steps:
2. **From Your Course Details** – View your available models directly in your AI-VERDE course.

1. Go to https://chat.cyverse.ai
2. After successfully logging in, click on the Details button of your course
3. Click on the "API Key" tab
4. The "Available Models" section will list all the models your course has access to
3. **Using Your API Key** – Retrieve a detailed list of models through the command line.

## Using your API Key to view your models

After obtaining your API Key from your course/team, you can obtain a detailed list of available models using curl:
## Viewing Models in the Course Details

```
curl -s -L "https://llm-api.cyverse.ai/v1/models" -H "Authorization: Bearer $OPENAI_API_KEY" -H 'Content-Type: application/json'
```
1. Go to [https://chat.cyverse.ai](https://chat.cyverse.ai)
2. Log in with your CyVerse credentials
3. Click "Details" on your course
4. Select the "API Key" tab
5. The "Available Models" section will display all models your course can access

Alternatively, you can use `jq` or python's json module to view the output in a more human readable format.

Option 1: If you have `jq` installed:
```
curl -s -L "https://llm-api.cyverse.ai/v1/models" -H "Authorization: Bearer $OPENAI_API_KEY" -H 'Content-Type: application/json'|jq
```
## Viewing Models Using Your API Key

Option 2: If you have python's json module installed:
After obtaining your "API Key" from your course or team, you can run the following command in your terminal to request a list of all models available to you.
This command uses `curl` to securely connect to the CyVerse API and return your model list in JSON format:

```bash
curl -s -L "https://llm-api.cyverse.ai/v1/models" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H 'Content-Type: application/json'
```
curl -s -L "https://llm-api.cyverse.ai/v1/models" -H "Authorization: Bearer $OPENAI_API_KEY" |python -m json.tool


The response from the API is returned in JSON format, which can appear as a single long block of text. To make it easier to read, you can format the output using tools like `jq` or Python’s built-in `json` module.


**Option 1: Using `jq`**

If you have the `jq` command-line tool installed, it will organize the JSON output into a clean, readable structure:

```bash
curl -s -L "https://llm-api.cyverse.ai/v1/models" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H 'Content-Type: application/json' | jq
```

**Option 2: Using Python’s Built-in JSON Module**

If you have Python installed, you can use its built-in JSON parser to format the output neatly:

```bash
curl -s -L "https://llm-api.cyverse.ai/v1/models" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
| python -m json.tool
```
81 changes: 81 additions & 0 deletions docs/api/api-token-continue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Using AI-VERDE with Continue.dev (VS Code Extension)

Continue.dev is an open-source coding assistant for Visual Studio Code that provides inline AI help for code completion, refactoring, and documentation. By connecting it to AI-VERDE, you can securely use CyVerse-hosted and course-approved models without exposing your code to external services.


## Prerequisites

Before getting started, make sure you have:

1. **AI-VERDE API Key**
- Obtain your key by following the [AI-VERDE API Token Guide](../api/api-token.md).

2. **Model Information**
- View available models and their names in the [AI-VERDE Model Documentation](../api/api-key-models.md).

3. **Visual Studio Code Installed**
- Download and install VS Code from the [VS Code website](https://code.visualstudio.com/).

4. **Continue.dev Extension Installed**
- In VS Code, open the Extensions tab (`Ctrl+Shift+X` or `Cmd+Shift+X`), search for “Continue”, and click Install.
- For more details, visit the [Continue.dev website](https://continue.dev/).


## 1. Sign In and Access Continue

1. Open Visual Studio Code.
2. In the sidebar, click on the Continue icon to open the panel.
3. If prompted, sign in with your Continue account (you can use GitHub, Google, or create a free account).
4. Once signed in, you’ll see the Continue chat interface and a Model tab.


## 2. Add AI-VERDE as a Model Provider

You can connect your AI-VERDE API Key directly from the [Continue.dev website](https://continue.dev/).

1. In the Continue sidebar, click the Model tab.
2. Scroll down to the bottom and click “Create Model”.
3. In the popup, use this as an example:

```bash
name: AI-Verde
version: 1.0.0
schema: v1

models:
- name: AI-Verde GPT-4o-mini
provider: openai
model: litellm_proxy/[MODEL NAME]
apiBase: https://llm-api.cyverse.ai/v1 #add this
apiKey: ${{ inputs.[AI-VERDE API KEY] }}
roles:
- chat
```

1. Click "Save".
2. Your new AI-VERDE model will appear in the model list in VS Code extenstion.

> **Tip:** You can add multiple AI-VERDE models if your course provides access to different ones. For example, a general model and a coding-focused model.


## 3. (Optional) Configure via JSON File

You can also edit the Continue configuration file manually for advanced customization.

1. Open the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`).
2. Type “Continue: Open Config File” and press "Enter".
3. Add or replace your configuration with the example below:

```json
{
"models": [
{
"title": "AI-VERDE GPT-4o-mini",
"model": "litellm_proxy/[MODEL NAME]",
"provider": "openai",
"apiBase": "https://llm-api.cyverse.ai/v1",
"apiKey": "[AI_VERDE_API_KEY]"
}
]
}
```
Empty file added docs/api/api-token-gradio.md
Empty file.
80 changes: 79 additions & 1 deletion docs/api/api-token-jupyter.md
Original file line number Diff line number Diff line change
@@ -1 +1,79 @@
# Examples of using your AI-VERDE API Token in Jupyter
# Examples of using your AI-VERDE API Token in Jupyter
This guide explains how to set up and use your AI-VERDE API Key inside Jupyter Notebook Once configured, you can send prompts, run code, and receive AI responses directly within your notebook.

## Prerequisites

1. **AI-VERDE API Key**
- Obtain your key by following the [AI-VERDE API Token Guide](https://aiverde-docs.cyverse.ai/api/api-token/).

2. **Model Information**
- View available models and their names in the [AI-VERDE Model Documentation](../api/api-key-models.md).

3. **Jupyter Installed**
- For intstalling Jupyter, visit [Jupyter Installation Website](https://jupyter.org/install).

## 1. Open Jupyter Notebook

After installing Jupyter, start it by running this command in your terminal:
```bash
jupyter notebook
```

## Add Your AI-VERDE API KEY

**Option 1** — Save It to Your System
This keeps your key private and reusable.

```bash
export AIVERDE_API_KEY="your_api_key_here"
```

**Option 2** — Enter It Inside the Notebook
If you prefer to enter it manually each time, use this in a new cell:

```bash
import os, getpass

if not os.getenv("AIVERDE_API_KEY"):
os.environ["AIVERDE_API_KEY"] = getpass.getpass("Enter your AI-VERDE API Key: ")
```
## Test the Connection
Now, let’s make sure your API key works. If everything works, you’ll see a list of available models.
```bash
import os, requests, json

API_URL = "https://llm-api.cyverse.ai/v1/models"
api_key = os.getenv("AIVERDE_API_KEY")

headers = {"Authorization": f"Bearer {api_key}"}
response = requests.get(API_URL, headers=headers)

print("Status Code:", response.status_code)
print(json.dumps(response.json(), indent=2))
```

## Send a Test Prompt to AI-VERDE
Use one of your models to send a message and enter your model ID

```bash
import os, requests, json

API_URL = "https://llm-api.cyverse.ai/v1/"
api_key = os.getenv("AIVERDE_API_KEY")

headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
data = {
"model": "litellm_proxy/[MODEL NAME]", # Replace with your model ID
"messages": [
{"role": "user", "content": "Hello AI-VERDE! What can you do?"}
]
}
response = requests.post(API_URL, headers=headers, json=data)
result = response.json()

# Display the model's response
print(result["choices"][0]["message"]["content"])
```
26 changes: 19 additions & 7 deletions docs/api/api-token-langchain.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
# Using your AI-VERDE API key to integrate with LangChain

## 1. Install LangChain python libraries
```bash
pip install langchain_community
## 1. Install LangChain Python Libraries

To begin integrating AI-VERDE with LangChain, install the required Python package:

```bash
pip install langchain_community
```

## 2. Obtain variables to integrate AI-VERDE with LangChain

Obtaining your AI-VERDE API key is outlined [here](/api/api-token/).
You will need your AI-VERDE API Key to connect LangChain to the CyVerse API.

**AI-VERDE API Key and API URL**
- Obtain your credentials by following the [AI-VERDE API Token Guide](api-token.md).

You can obtain a list of the models you have access to with the following command; denoted by "id":
Once you have your key, you can view the models you have access to (identified by their `id`) with the following command:
```bash
curl -s -L "https://llm-api.cyverse.ai/v1/models" -H "Authorization: Bearer [AI-VERDE API KEY]" -H 'Content-Type: application/json'|jq
curl -s -L "https://llm-api.cyverse.ai/v1/models" \
-H "Authorization: Bearer [AI-VERDE API KEY]" \
-H 'Content-Type: application/json' | jq
```
## 3. Create python scripts
You can now connect AI-VERDE to LangChain using the following Python example.
Before running the script, make sure to:
- Replace `[MODEL NAME]` with one of your available model IDs.
- Replace `[AI-VERDE API KEY]` with your personal API key

```python
from langchain_community.chat_models import ChatLiteLLM

Expand All @@ -27,7 +39,7 @@ print (llm.invoke("Hello, world!"))
```


Alternatively, you can include the API key as an environment variable or secret to avoid storing it in plain text:
To keep your API key secure, you can store it as an `environment variable` instead of typing it directly into your script. This ensures your credentials remain private if you share or upload your code.

```python
import getpass
Expand Down
Loading