Releases: matlab-deep-learning/llms-with-matlab
v4.0.0: Structured Output
This release includes new features and bug fixes.
Ensure output format using structured output
You can now use structured output to generate output using openAIChat
or azureChat
objects.
In LLMs with MATLAB, you can specify the structure of the output in two different ways.
- Specify a valid JSON Schema directly.
- Specify an example structure array that adheres to the required output format. The software automatically generates the corresponding JSON Schema and provides this to the LLM. Then, the software automatically converts the output of the LLM back into a structure array.
To do this, set the ReponseFormat
name-value argument of openAIChat
, azureChat
, or generate
to:
- A string scalar containing a valid JSON Schema.
- A structure array containing an example that adheres to the required format, for example:
ResponseFormat=struct("Name","Rudolph","NoseColor",[255 0 0])
For more information on structured output, see https://platform.openai.com/docs/guides/structured-outputs.
Argument name changes
The Model
name-value argument of ollamaChat
has been renamed to ModelName
. However, you can still use Model
instead.
The Deployment
name-value argument of azureChat
has been renamed to DeploymentID
. However, you can still use Deployment
instead.
v3.4.0: Documentation, support for OpenAI o1 models, general updates
This release includes new features, new documentation, and bug fixes.
New Features
Support for OpenAI® o1 models
You can now use the OpenAI models o1-mini and o1-preview to generate text from MATLAB®. When you create an openAIChat
object, set the ModelName
name-value argument to "o1-mini"
or "o1-preview"
.
Temporarily override model parameters when generating text
You can now set model parameters such as MaxNumToken
and ResponseFormat
for a single API call by using the corresponding name-value arguments of the generate
function. The generate
function will then use the specified parameter for text generation instead of the corresponding model parameter of the openAIChat
, azureChat
, or ollamaChat
input.
For a full list of supported model parameters, see generate.
Support for min-p sampling in Ollama™
You can now set the minimum probability ratio to tune the frequency of improbable tokens when generating text using Ollama models. You can do this in two different ways:
- When you create an
ollamaChat
object, specify theMinP
name-value argument. - When you generate text using the
generate
function with anollamaChat
object, specify theMinP
name-value argument.
New Documentation
There is now detailed documentation for the features included in LLMs with MATLAB:
- openAIChat
- azureChat
- ollamaChat
- generate
- openAIFunction
- addParameter
- openAIImages
- openAIImages.generate
- edit
- createVariation
- messageHistory
- addSystemMessage
- addUserMessage
- addUserMessageWithImages
- addToolMessage
- addResponseMessage
- removeMessage
You can find these pages in a new directory functions
inside the doc
directory.
Full Changelog: v3.3.0...v3.4.0
v3.3.0: Vision support in Ollama
Vision Support in Ollama
This release adds support for vision models in Ollama™. This will allow you to use the ollamaChat
function to describe images.
For an example, see Understanding the Content of an Image.
Full Changelog: v3.2.0...v3.3.0
v3.2.0: Supporting Ollama servers not on localhost:11434
What's Changed
- gpt-4o-mini does handle images by @ccreutzi in #52
- Add support for remote ollama by @ccreutzi in #53
Full Changelog: v3.1.0...v3.2.0
v3.1.0: Update OpenAI models
What's Changed
- Azure api version tests by @vpapanasta in #46
- Adding extra tests to increase code coverage in ollamaChat and azureChat by @vpapanasta in #47
- Add Ollama-based RAG example by @ccreutzi in #45
- Create uihtml inside uifigure by @ccreutzi in #48
- Add gpt-4o-mini and make it the default by @ccreutzi in #50
Full Changelog: v3.0.0...v3.1.0
Ollama and Azure Support
Adding Ollama® and Azure® support
With this release, we have added ollamaChat
and azureChat
to connect to local LLMs (with an Ollama installation) or deployments hosted on Azure OpenAI® Services. See Ollama.md and Azure.md for details.
Also included is a list of updates (such as supporting newer models on OpenAI®), bug fixes, and general code and test improvements. See the long list below.
Auto-generated What's Changed List
- Dev update gpt 4 vision preview by @toshiakit in #9
- Support function calls in streaming by @toshiakit in #10
- Dev fix tool choice bug by @toshiakit in #12
- Improved error message by @toshiakit in #13
- Improve the text from examples and README by @debymf in #16
- Reflecting the updated models released on April 9, 2024 by @toshiakit in #18
- Update actions to latest versions by @mcafaro in #20
- Fix argument validation for extractOpenAIEmbeddings by @debymf in #19
- Fixing checks for images and empty prompts. by @debymf in #21
- Fix function call by @debymf in #23
- Create pull request to to update activate-code-coverage with new content from main by @vpapanasta in #25
- Activate code coverage by @vpapanasta in #26
- Fix parallel calls by @debymf in #22
- Fix broken link in README. by @debymf in #28
- OPENAI_KEY as env variable and extra tests by @vpapanasta in #27
- Adding FEX Badge by @debymf in #30
- Add example tests by @vpapanasta in #34
- Updated to support gpt-4o by @toshiakit in #33
- little bit of code reformatting by @ccreutzi in #36
- Move model capabilitiy verification out of openAIChat.m, for maintain… by @ccreutzi in #37
- Add functionSignatures.json by @ccreutzi in #38
- Adding missing testAnalyzeSentimentinTextUsingChatGPTinJSONMode by @vpapanasta in #39
- Websave to get images by @ccreutzi in #40
- Test using DALL•E to edit images by @ccreutzi in #41
- test the chatbot example, with a fake input function by @ccreutzi in #42
- Increase websave timeout by @ccreutzi in #44
- move size check into arguments block by @ccreutzi in #43
- Adding support to Azure API by @AngelVegaAlvarez in #8
New Contributors
- @toshiakit made their first contribution in #9
- @mcafaro made their first contribution in #20
- @vpapanasta made their first contribution in #25
- @ccreutzi made their first contribution in #36
- @AngelVegaAlvarez made their first contribution in #8
Full Changelog: v2.0.0...v3.0.0
v2.0.0
Initial release
v1.0.0 Fixing argument block