Can we run this prompt locally instead of using OpenAI?

There's no doubt that OpenAI's models are state-of-the-art, but you can quickly incur a lot of cost, be plagued by latency or reliability issues, and not every organization wants to send their data to OpenAI.

Learn

Testing Open-Source Models

It's possible to run and test open-source models like Mistral or LLaMA today on your laptop so long as you have an M1 mac or PC with a graphics card...More

Experience

Mike Taylor

Built a 50-person growth agency.
Logo
Logo
Logo
💪 Useful 0
😓 Difficult 0
🎉 Fun 0
😴 Boring 0
🚨 Errors 0
😕 Confusing 0
🤓 Interesting 0
Premium subscription required.
Python experience recommended.
1. Scenario
UPSERT HEADQUARTERS – THE DAY BEFORE END OF QUARTER
We're in the Upsert headquarters the day before the end of the quarter and Sally Valentine, the Head of Marketing, has tasked us with finding a way to run a prompt locally instead of using OpenAI. She's looking for a way to test open source models, measure latency and response, and get reliable results at a lower cost.
Sally Valentine
at Upsert

We need to find a way to run this prompt locally and still get reliable results.

OpenAI's API is expensive and unreliable.

We need to find a way to test open source models that is cheaper and more reliable.

Any ideas?\n

We can't afford to wait for the results and miss out on a potential winning combination.

Can anyone think of a framework or way of designing the experiment so that we can get results quickly?

This course is a work of fiction. Unless otherwise indicated, all the names, characters, businesses, data, places, events and incidents in this course are either the product of the author's imagination or used in a fictitious manner. Any resemblance to actual persons, living or dead, or actual events is purely coincidental.

2. Brief

Testing Open-Source Models

Open-source models have become increasingly popular in recent years, as developers and researchers look for ways to improve their machine learning models without breaking the bank. As a result, many developers have turned to tools such as LM Studio to test open-source models on their local machine. In this blog post, we’ll take a look at how to get started testing open-source models with LM Studio, and how to measure the performance of the model.

The first step in testing open-source models is to download LM Studio, which is a free tool available for Mac and PC. Once it is installed, you can search for the model you want to use. For example, if you wanted to use the popular Misra model, you can find it on Hugging Face. You can also read more about the model on its documentation page, which can help you decide which model you want to use.

Once you have chosen the model, you need to decide which quantization technique you want to use. Quantization is a technique used to reduce the size and speed of the model. The best option is usually KMQ4, but you can also experiment with other techniques such as Chaos Stress or KMQ8. Once you have chosen the right quantization technique, you can then set up a server to run the model locally.

The next step is to test the model by sending it a prompt. To do this, you need to use the same format as you would use when sending a prompt to OpenAI. You can use the LM Studio tools to generate the prompt, which will generate the system prompt and the assistant message. You can also set the system prompt or user prompt separately.

Once the prompt is set, you can then measure the latency of the model. To do this, you can use a function to time the model when it is called. This will measure the latency and the response, and will also store the result in an object. You can then plot the results using Matplotlib to get an idea of how the model is performing.

By testing open-source models, you can get an idea of how the model performs on your prompt. You can also measure the latency of the model, and compare it to other models such as GPT-3.5 Turbo and GPT-4. By testing the model, you can also get an idea

3. Tutorial

 Hey, I'm going to show you how to test open source models on your local computer. This is a tool called LM studio. I found this is working really well for me. Specifically. On my end to Mac although it should work on. Yeah. On your PC as well. I'm not going to go through the download instructions because I think if you want to install it, you should just go to LMC D or. AI.

testing-llmstudio.ipynb
Download
4. Exercises
5. Certificate

Share This Course