{"id":24098456,"url":"https://github.com/matlab-deep-learning/llms-with-matlab","last_synced_at":"2025-04-05T11:09:41.370Z","repository":{"id":199319858,"uuid":"702556818","full_name":"matlab-deep-learning/llms-with-matlab","owner":"matlab-deep-learning","description":"Connect MATLAB to LLM APIs, including OpenAI® Chat Completions, Azure® OpenAI Services, and Ollama™","archived":false,"fork":false,"pushed_at":"2024-10-29T10:27:45.000Z","size":77480,"stargazers_count":107,"open_issues_count":3,"forks_count":23,"subscribers_count":17,"default_branch":"main","last_synced_at":"2024-10-29T12:10:04.328Z","etag":null,"topics":["azure","chatgpt-api","llm","matlab","ollama","ollama-api","openai-api","openai-chatgpt"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matlab-deep-learning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-09T14:39:17.000Z","updated_at":"2024-10-29T10:04:55.000Z","dependencies_parsed_at":"2024-01-26T19:24:11.938Z","dependency_job_id":"451d2173-7368-4839-b809-5d279d3cedbb","html_url":"https://github.com/matlab-deep-learning/llms-with-matlab","commit_stats":null,"previous_names":["matlab-deep-learning/llms-with-matlab"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2Fllms-with-matlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2Fllms-with-matlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2Fllms-with-matlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2Fllms-with-matlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matlab-deep-learning","download_url":"https://codeload.github.com/matlab-deep-learning/llms-with-matlab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325693,"owners_count":20920714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","chatgpt-api","llm","matlab","ollama","ollama-api","openai-api","openai-chatgpt"],"created_at":"2025-01-10T14:45:57.187Z","updated_at":"2025-04-05T11:09:41.352Z","avatar_url":"https://github.com/matlab-deep-learning.png","language":"MATLAB","funding_links":[],"categories":["Langchain","Artificial Intelligence and Machine Learning"],"sub_categories":[],"readme":"\n# Large Language Models (LLMs) with MATLAB\n\n[![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=matlab-deep-learning/llms-with-matlab) [![View Large Language Models (LLMs) with MATLAB on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/163796-large-language-models-llms-with-matlab) \n\nLarge Language Models (LLMs) with MATLAB lets you connect to large language model APIs using MATLAB®. \n\n\nYou can connect to:\n\n-  [OpenAI® Chat Completions API](https://platform.openai.com/docs/guides/text-generation/chat-completions-api) — For example, connect to ChatGPT™. \n-  [OpenAI Images API](https://platform.openai.com/docs/guides/images) — For example, connect to DALL·E™. \n-  [Azure® OpenAI Service](https://learn.microsoft.com/en-us/azure/ai-services/openai/) — Connect to OpenAI models from Azure. \n-  [Ollama™](https://ollama.com/) — Connect to models locally or nonlocally. \n\nUsing this add-on, you can:\n\n-  Generate responses to natural language prompts.\n-  Manage chat history.\n-  Generate JSON\\-formatted and structured output. \n-  Use tool calling.  \n-  Generate, edit, and describe images. \n\nFor more information about the features in this add-on, see the documentation in the [`doc`](/doc) directory.\n\n# Installation\n\nUsing this add-on requires MATLAB R2024a or newer.\n\n## Use MATLAB Online\n\nYou can use the add-on in MATLAB Online™ by clicking this link: [![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=matlab-deep-learning/llms-with-matlab) \n\nIn MATLAB Online, you can connect to OpenAI and Azure. To connect to Ollama, use an installed version of MATLAB and install the add\\-on using the Add\\-On Explorer or by cloning the GitHub™ repository.\n\n## Install using Add\\-On Explorer\n\nThe recommended way of using the add-on on an installed version of MATLAB is to use the Add\\-On Explorer.\n\n1. In MATLAB, go to the **Home** tab, and in the **Environment** section, click the **Add\\-Ons** icon.\n2. In the Add\\-On Explorer, search for \"Large Language Models (LLMs) with MATLAB\".\n3. Select **Install**.\n## Install by Cloning GitHub Repository\n\nAlternatively, to use the add-on on an installed version of MATLAB, you can clone the GitHub repository. In the MATLAB Command Window, run this command:\n\n```\n\u003e\u003e !git clone https://github.com/matlab-deep-learning/llms-with-matlab.git\n```\n\nTo run code from the add-on outside of the installation directory, if you install the add-on by cloning the GitHub repository, then you must add the path to the installation directory.\n\n```\n\u003e\u003e addpath(\"path/to/llms-with-matlab\")\n```\n# Get Started with External APIs\n\nFor more information about how to connect to the different APIs from MATLAB, including installation requirements, see:\n- [OpenAI](/doc/OpenAI.md)\n- [Azure OpenAI Service](/doc/Azure.md)\n- [Ollama](/doc/Ollama.md)\n\n# Examples\n\n- [Process Generated Text in Real Time by Using ChatGPT in Streaming Mode](/examples/ProcessGeneratedTextinRealTimebyUsingChatGPTinStreamingMode.md) \n- [Process Generated Text in Real Time by Using Ollama in Streaming Mode](/examples/ProcessGeneratedTextinRealTimebyUsingOllamaInStreamingMode.md) \n- [Summarize Large Documents Using ChatGPT and MATLAB](/examples/SummarizeLargeDocumentsUsingChatGPTandMATLAB.md) (requires Text Analytics Toolbox™)\n- [Create Simple ChatBot](/examples/CreateSimpleChatBot.md) (requires Text Analytics Toolbox)\n- [Create Simple Ollama ChatBot](/examples/CreateSimpleOllamaChatBot.md) (requires Text Analytics Toolbox)\n- [Analyze Scientific Papers Using ChatGPT Function Calls](/examples/AnalyzeScientificPapersUsingFunctionCalls.md)\n- [Analyze Sentiment in Text Using ChatGPT and Structured Output](/examples/AnalyzeSentimentinTextUsingChatGPTwithStructuredOutput.md)\n- [Analyze Text Data Using Parallel Function Calls with ChatGPT](/examples/AnalyzeTextDataUsingParallelFunctionCallwithChatGPT.md)\n- [Analyze Text Data Using Parallel Function Calls with Ollama](/examples/AnalyzeTextDataUsingParallelFunctionCallwithOllama.md)\n- [Retrieval-Augmented Generation Using ChatGPT and MATLAB](/examples/RetrievalAugmentedGenerationUsingChatGPTandMATLAB.md) (requires Text Analytics Toolbox)\n- [Retrieval-Augmented Generation Using Ollama and MATLAB](/examples/RetrievalAugmentedGenerationUsingOllamaAndMATLAB.md) (requires Text Analytics Toolbox)\n- [Describe Images Using ChatGPT](/examples/DescribeImagesUsingChatGPT.md)\n- [Using DALL·E To Edit Images](/examples/UsingDALLEToEditImages.md)\n- [Using DALL·E To Generate Images](/examples/UsingDALLEToGenerateImages.md)\n\n# Functions\n| **Function**   | **Description**  |\n| :-- | :-- | \n| [openAIChat](/doc/functions/openAIChat.md) | Connect to OpenAI Chat Completion API from MATLAB |\n| [azureChat](/doc/functions/azureChat.md) | Connect to Azure OpenAI Services Chat Completion API from MATLAB |\n| [ollamaChat](/doc/functions/ollamaChat.md) | Connect to Ollama Server from MATLAB |\n| [generate](/doc/functions/generate.md) | Generate output from large language models |\n| [openAIFunction](/doc/functions/openAIFunction.md) | Use Function Calls from MATLAB |\n| [addParameter](/doc/functions/addParameter.md) | Add input argument to `openAIFunction` object |\n| [openAIImages](/doc/functions/openAIImages.md) | Connect to OpenAI Image Generation API from MATLAB |\n| [openAIImages.generate](/doc/functions/openAIImages.generate.md) | Generate image using OpenAI image generation API |\n| [edit](/doc/functions/edit.md) | Edit images using DALL·E 2 |\n| [createVariation](/doc/functions/createVariation.md) | Generate image variations using DALL·E 2 |\n| [messageHistory](/doc/functions/messageHistory.md) | Manage and store messages in a conversation |\n| [addSystemMessage](/doc/functions/addSystemMessage.md) | Add system message to message history |\n| [addUserMessage](/doc/functions/addUserMessage.md) | Add user message to message history |\n| [addUserMessageWithImages](/doc/functions/addUserMessageWithImages.md) | Add user message with images to message history |\n| [addToolMessage](/doc/functions/addToolMessage.md) | Add tool message to message history |\n| [addResponseMessage](/doc/functions/addResponseMessage.md) | Add response message to message history |\n| [removeMessage](/doc/functions/removeMessage.md) | Remove message from message history |\n\n## License\n\nThe license is available in the [license.txt](license.txt) file in this GitHub repository.\n\n## Community Support\n[MATLAB Central](https://www.mathworks.com/matlabcentral)\n\nCopyright 2023-2025 The MathWorks, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatlab-deep-learning%2Fllms-with-matlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatlab-deep-learning%2Fllms-with-matlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatlab-deep-learning%2Fllms-with-matlab/lists"}