<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>LLM Studio on Ash Tewari</title><link>https://www.tewari.info/tag/llmstudio/</link><description>Recent content in LLM Studio on Ash Tewari</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Mon, 05 Feb 2024 01:10:11 +0000</lastBuildDate><atom:link href="https://www.tewari.info/tag/llmstudio/feed.xml" rel="self" type="application/rss+xml"/><item><title>Iterative Prompt Engineering with LLMStudio</title><link>https://www.tewari.info/2024/02/04/iterative-prompt-engineering-with-llmstudio/</link><pubDate>Mon, 05 Feb 2024 01:10:11 +0000</pubDate><guid>https://www.tewari.info/2024/02/04/iterative-prompt-engineering-with-llmstudio/</guid><description>&lt;p&gt;Creating the ideal prompt can be the key to transforming a less than average outcome into one that is remarkably relevant. Discovering the right prompt often involves numerous revisions and a method of trial and error. I felt the need to refer to my past attempts, modifications made to prompts, LLM models I tried and other LLM settings as well relative cost of these combinations. There are a few options to help with this : &lt;a class="link" href="https://github.com/microsoft/promptflow" target="_blank" rel="noopener"&#10; &gt;promptflow&lt;/a&gt;, &lt;a class="link" href="https://www.langchain.com/langsmith" target="_blank" rel="noopener"&#10; &gt;langsmith&lt;/a&gt;, &lt;a class="link" href="https://github.com/TensorOpsAI/LLMStudio" target="_blank" rel="noopener"&#10; &gt;LLMStudio&lt;/a&gt; and others.&lt;/p&gt;&#10;&lt;p&gt;I tried LLMStudio and promptflow. This article is about LLMStudio.&lt;/p&gt;&#10;&lt;p&gt;If you are installing LLMStudio on Windows, use &lt;a class="link" href="https://learn.microsoft.com/en-us/windows/wsl/" target="_blank" rel="noopener"&#10; &gt;WSL&lt;/a&gt;. Here are the steps :&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Create a folder on your machine.&lt;/li&gt;&#10;&lt;li&gt;Create .env file here with following content:&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;OPENAI_API_KEY=&amp;#34;sk-api_key&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ANTHROPIC_API_KEY=&amp;#34;sk-api_key&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&#10;&lt;li&gt;Enter wsl and create a new python environment with conda&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;(base) PS c:\code\llmstudio&amp;gt; wsl&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;(base) ash@DESKTOP:/mnt/d/code/llmstudio$ conda activate lmstd&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;LLMStudio runs on &lt;a class="link" href="https://bun.sh/" target="_blank" rel="noopener"&#10; &gt;Bun&lt;/a&gt;. Bun is a javascript runtime like &lt;a class="link" href="https://nodejs.org/en" target="_blank" rel="noopener"&#10; &gt;Node&lt;/a&gt;.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Instructions for installing bun on windows :&lt;br&gt;&#10;&lt;a class="link" href="https://bun.sh/docs/installation#windows" target="_blank" rel="noopener"&#10; &gt;https://bun.sh/docs/installation#windows&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install unzip&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;powershell -c &amp;#34;irm bun.sh/install.ps1|iex&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;img src="https://www.tewari.info/wp-content/image-27.png"&gt;&#10;&lt;/figure&gt;&#10;&#10;&lt;ul&gt;&#10;&lt;li&gt;Install Node v18, if you run into ReferenceError: Request is not defined    at Object.&lt;anonymous&gt; (/home/ash/miniconda3/lib/python3.11/site-packages/llmstudio/ui/node_modules/next/dist/server/web/spec-extension/request.js:28:27)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;figure&gt;&lt;img src="https://www.tewari.info/wp-content/image-31.png"&gt;&#10;&lt;/figure&gt;&#10;&#10;&lt;ul&gt;&#10;&lt;li&gt;Start LLMStudio&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;figure&gt;&lt;img src="https://www.tewari.info/wp-content/image-32.png"&gt;&#10;&lt;/figure&gt;&#10;&#10;&lt;figure&gt;&lt;img src="https://www.tewari.info/wp-content/image-33.png"&gt;&#10;&lt;/figure&gt;&#10;&#10;&lt;figure&gt;&lt;img src="https://www.tewari.info/wp-content/image-34.png"&gt;&#10;&lt;/figure&gt;&#10;&#10;&lt;figure&gt;&lt;img src="https://www.tewari.info/wp-content/image-35.png"&gt;&#10;&lt;/figure&gt;&#10;&#10;&lt;p&gt;Export the execution data as csv file by clicking on [Export data] button. This data includes the input, output, LLM model, Input and Output tokens as well as cost.&lt;/p&gt;&#10;&lt;figure&gt;&lt;img src="https://www.tewari.info/wp-content/image-37.png"&gt;&#10;&lt;/figure&gt;&#10;&#10;&lt;p&gt;References&lt;br&gt;&#10;&lt;a class="link" href="https://www.tensorops.ai/post/what-is-llmstudio" target="_blank" rel="noopener"&#10; &gt;What is LLMstudio?&lt;/a&gt;&lt;br&gt;&#10;&lt;a class="link" href="https://github.com/TensorOpsAI/LLMstudio" target="_blank" rel="noopener"&#10; &gt;LLMstudio&lt;/a&gt; by &lt;a class="link" href="http://tensorops.ai/" target="_blank" rel="noopener"&#10; &gt;TensorOps&lt;/a&gt;&lt;br&gt;&#10;&lt;a class="link" href="https://docs.llmstudio.ai/quickstart" target="_blank" rel="noopener"&#10; &gt;LLM Studio Quickstart&lt;/a&gt;&lt;br&gt;&#10;&lt;a class="link" href="https://dev.to/openhacking/install-bun-for-windows-a-modern-javascript-runtime-like-node-or-deno-449e" target="_blank" rel="noopener"&#10; &gt;Install Bun for Windows&lt;/a&gt;&lt;br&gt;&#10;&lt;a class="link" href="https://medium.com/@raj.nagaraj1990/setup-bun-js-in-windows-using-wsl-and-vs-code-712a00cd82a1" target="_blank" rel="noopener"&#10; &gt;Setup Bun JS in windows using WSL and VS code&lt;/a&gt;&lt;br&gt;&#10;&lt;a class="link" href="https://stackoverflow.com/questions/77383943/nextjs-referenceerror-request-is-not-defined-reading-old-version-of-node-s" target="_blank" rel="noopener"&#10; &gt;NextJS - ReferenceError: Request is not defined&lt;/a&gt;&lt;/p&gt;&#10;</description></item></channel></rss>