Skip to content

Commit

Permalink
Merge pull request #41 from toshiakit/dev_update_submodule_install_in…
Browse files Browse the repository at this point in the history
…structions

Updated README, Added MATLAB Vault and Focus Mode Support
  • Loading branch information
nothans authored Jul 2, 2024
2 parents ac29ce4 + 5a51c1b commit f4ffc79
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
Binary file modified MatGPT.mlapp
Binary file not shown.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ MatGPT is a MATLAB app that allows you to easily access OpenAI's ChatGPT API. Wi

The app simply serves as an interface to the ChatGPT API. You should be familiar with the limitations and risks associated with using this technology as well as with [OpenAI terms and policies](https://openai.com/policies). You are responsible for any fees OpenAI may charge for the use of their API.

MatGPT was updated to run on the framework from the '[Large Language Models (LLMs) with MATLAB](https://github.com/matlab-deep-learning/llms-with-matlab/)' repo maintained by MathWorks.
MatGPT requires '[Large Language Models (LLMs) with MATLAB](https://github.com/matlab-deep-learning/llms-with-matlab/)' library maintained by MathWorks.

[MATLAB AI Chat Playground](https://www.mathworks.com/matlabcentral/playground/) is a great alternative to MatGPT on MATLAB Central.

## What's New

* MatGPT runs on the 'LLMs with MATLAB' framework, which requires MATLAB R2023a or later.
* MatGPT loads 'LLMs with MATLAB' library as a submodule.
* MatGPT stores your API in MATLAB Vault on R2024a or later. The stored API will persist from session to session.
* MatGPT supports streaming API where response tokens are displayed as they come in.
* MatGPT detects a URL included in a prompt, and retrieves its web content into the chat.
* MatGPT lets you import a .m, .mlx, .csv or .txt file into the chat. PDF files are also supported if Text Analytics Toolbox is available.
Expand All @@ -29,21 +30,25 @@ Please note that:

## Requirements

* **Submodule**: '[Large Language Models (LLMs) with MATLAB](https://github.com/matlab-deep-learning/llms-with-matlab/)
* **MathWorks Products (https://www.mathworks.com)**: Use MatGPT to run on [MATLAB Online](https://www.mathworks.com/products/matlab-online.html) that comes with the most commonly used toolboxes. To use it on desktop, you must have MATLAB R2023a or later installed on your computer.
* **OpenAI API Key**: Additionally, you will need your own API key from [https://platform.openai.com/account/api-keys](https://platform.openai.com/account/api-keys). If you don’t want to set up an API access with OpenAI, [MATLAB AI Chat Playground](https://www.mathworks.com/matlabcentral/playground/) is a better option.
* **OpenAI API Key**: Additionally, you will need your own API key from [https://platform.openai.com/api-keys](https://platform.openai.com/api-keys). If you don’t want to set up an API access with OpenAI, [MATLAB AI Chat Playground](https://www.mathworks.com/matlabcentral/playground/) is a better option.
* GPT-4 models are [available to all API users who have a history of successful payments](https://openai.com/blog/gpt-4-api-general-availability). If you have not made any payment to OpenAI, the GPT-4 models are not accessible.

## Installation

### MATLAB Online

To use MatGPT on MATLAB Online, simply click [![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=toshiakit/MatGPT&file=MatGPT.mlapp)
To use MatGPT on MATLAB Online, simply click [![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=toshiakit/MatGPT&file=MatGPT.mlapp) MATLAB Online pulls the content of this repo, including "LLMS with MATLAB" submodule.

#### MATLAB Desktop

1. Download the content of this repository into a MATLAB path.
2. Launch MATLAB
3. type 'MatGPT' in the command window
Use Git commands to clone the repo to your local directory, and then clone the submodules. This will ensure you get the 'LLMs with MATLAB' library.
```
git clone https://github.com/toshiakit/MatGPT.git
git submodule update --init
```
If you download MatGPT as a Zip file, the zip file will not contain the submodule. You need to download 'LLMs with MATLAB' separately and unzip into the 'LLMs with MATLAB' folder in the helpers folder.

## How to use: MatGPT app

Expand Down
4 changes: 2 additions & 2 deletions helpers/MsgHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

function s = startupMessages()
% add startup messages
s = struct('role',"MagGPT",'content',[]);
s = struct('role',"MatGPT",'content',[]);
s.content = "This app provides access to the ChatGPT API " + ...
"from OpenAI. To use this app, you need to obtain " + ...
"your own API key via <a href='https://platform.openai.com/account/api-keys' target='_blank'>" + ...
Expand All @@ -36,7 +36,7 @@
"terms and policies</a>.";
s.content = [s.content,"<p style='font-size: 1.1em; font-weight: bold'>To get started, click ""+ New Chat"" or the name of a previous chat.</p>"];
s.content = [s.content,"<strong>What's New</strong>: " + ...
"<ul><li>Runs on the <a href='https://github.com/matlab-deep-learning/llms-with-matlab' target='_blank'>LLMs with MATLAB</a> framework, which requires MATLAB R2023a or later</li>" + ...
"<ul><li>Loads '<a href='https://github.com/matlab-deep-learning/llms-with-matlab' target='_blank'>LLMs with MATLAB</a>' as a submodule</li>" + ...
"<li>Detects a URL included in a prompt, and retrieve its content into the chat.</<li>" + ...
"<li>Lets you import a .m, .mlx, .csv, or .txt file into the chat</li>" + ...
"<li>Supports GPT-4 Turbo with Vision with .jpg, .png or .gif images</li>" + ...
Expand Down

0 comments on commit f4ffc79

Please sign in to comment.