Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add-new-model-section
  • Loading branch information
pruthvi-yb committed Nov 26, 2024
commit 505290c16b580bd285c58418595f1b22733c37cb
63 changes: 63 additions & 0 deletions docs/add-new-model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: 🆕 Add New Model
description: Learn how to update the PearAI `config.json` file to add models like Ollama and OpenRouter.
keywords: [pearai, add model, ollama, openrouter, config.json]
---

Follow these steps to integrate models like Ollama and OpenRouter into PearAI.

---

## How to Use Ollama with PearAI

### Method 1: Update `config.json`

1. Open the PearAI `config.json` file.
2. Add the model to the `models` array:

```json
"models": [
{
"name": "startcoder2",
"provider": "ollama",
"version": "latest"
}
]
```

3. Save and Reload:
Save the file, and PearAI will automatically recognize the new model.

### Method 2: Using the Add Model Feature

1. Open the Add Model section in PearAI.
![Add Model](../static/img/add-model.png)

2. Select **Other**
![Select Other](../static/img/select-other.png)

3. Then choose **Ollama**.
![Select Ollama](../static/img/select-ollama.png)

4. #### Follow the on-screen instructions to complete the setup

---

## How to Use OpenRouter with PearAI

### Step 1: Obtain an API Key

1. Register at OpenRouter and generate an API key.

### Step 2: Use the Add Model Feature

1. Open the Add Model section in PearAI.
![Add Model](../static/img/add-model.png)

2. Select **Other**,
![Select Other](../static/img/select-other.png)

3. Then choose **OpenRouter**.
![Select OpenRouter](../static/img/select-openrouter.png)

4. Follow the on-screen instructions to complete the setup.
3 changes: 2 additions & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
docsSidebar: [
"index",
"index",
"quickstart",
"demos",
"at-commands",
"add-new-model",
"important-shortcuts",
"tab-autocomplete",
"models-and-usage",
Expand Down
Binary file added static/img/add-model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/select-ollama.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/select-openrouter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/select-other.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4262,11 +4262,6 @@ fs.realpath@^1.0.0:
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==

fsevents@~2.3.2:
version "2.3.3"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==

function-bind@^1.1.2:
version "1.1.2"
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz"
Expand Down