The MATLAB Blog

Practical Advice for People on the Leading Edge

4 ways of using MATLAB with Large Language Models (LLMs) such as ChatGPT and Ollama

Everyone's talking about Large Language Models (LLMs) and a huge number of you are using them too. Here are 4 ways to make use of them in the MathWorks ecosystem right now, no matter what your skill level is.

1. MATLAB AI Chat Playground

First released in 2023 with Chat GPT 3.5 Turbo as the underlying model, the MATLAB AI Chat Playground has recently been upgraded to use GPT-4o mini. As well as talking to the AI in the left hand side of the browser window, you can also run MATLAB code in the right hand-side using an engine that is based on the latest release of MATLAB, R2024b. AI and MATLAB together without needing to leave your web browser. This is probably the easiest way for MATLAB users to get started with experimenting with AI models.

2. Large Language Models (LLMS) with MATLAB

As a programmer, I have more fun with LLMS when I can interact with them programmatically. That's where this MathWorks repository comes in. It contains code to connect MATLAB to the OpenAI® Chat Completions API (which powers ChatGPT™), OpenAI Images API (which powers DALL·E™), Azure® OpenAI Service, and both local and nonlocal Ollama™ models. This allows you to leverage the natural language processing capabilities of large language models directly within your MATLAB environment.
The repo was discussed in depth in January 2024 over at the MathWorks Artificial Intelligence blog,
For a great example of what's possible with this repository, see Toshi Takeuchi's personal project MatGPT which allows you to easily access OpenAI's API with an app.

3. GitHub Co-pilot with the MATLAB extension for Visual Studio Code

The MATLAB extension for Visual Studio Code has been extremely popular since its release in 2023 and I've covered it several times in The MATLAB Blog. Most recently in March of this year when I described code execution and the fact that it works great with GitHub co-pilot.
CoPilot_1.gif

4. Custom MATLAB GPT in the OpenAI GPT Store

This one is for users of the ChatGPT site. The custom MATLAB GPT currently uses the GPT-4o model but has some additional customizations especially for MATLAB users. In particular, the AI uses Retrieval Augmented Generation (RAG) to search the MathWorks website before formulating an answer
|
  • print

댓글

댓글을 남기려면 링크 를 클릭하여 MathWorks 계정에 로그인하거나 계정을 새로 만드십시오.