<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Namee</title>
    <description>The latest articles on DEV Community by Namee (@noberst).</description>
    <link>https://dev.to/noberst</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1161319%2F58d313f5-ca44-4c89-99d4-d0f859fab4ed.png</url>
      <title>DEV Community: Namee</title>
      <link>https://dev.to/noberst</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/noberst"/>
    <language>en</language>
    <item>
      <title>How I Combined Small Language Models to Automate Workflow like Financial Research</title>
      <dc:creator>Namee</dc:creator>
      <pubDate>Mon, 29 Apr 2024 14:15:16 +0000</pubDate>
      <link>https://dev.to/llmware/how-i-combine-small-language-models-to-automate-fact-based-workflow-like-financial-research-29np</link>
      <guid>https://dev.to/llmware/how-i-combine-small-language-models-to-automate-fact-based-workflow-like-financial-research-29np</guid>
      <description>&lt;p&gt;More and more people are recognizing that small language models can provide great, on par results when used in specific workflows. &lt;/p&gt;

&lt;p&gt;Clem Delangue, CEO of HuggingFace, even suggested that up to 99% of use cases can be addressed using SLMs in a recent VentureBeat article.&lt;/p&gt;




&lt;h1&gt;
  
  
  The next wave of Gen AI will be automating workflows
&lt;/h1&gt;

&lt;p&gt;While Chatbots are one of the great use cases for Large Language Models, the next true groundbreaking use case for Gen AI for 2024 will be automating workflows.&lt;/p&gt;

&lt;p&gt;Of course, if you are an AI expert reading this, the idea of chaining together various AI agent workflows with prompts is not new. However, what is new and still to be explored much more is the concept of multi-model agentic workflow with small language models (SLMs).&lt;/p&gt;




&lt;h2&gt;
  
  
  What are Small Language Models?
&lt;/h2&gt;

&lt;p&gt;The definition of SLMs vary depending on who you ask. &lt;/p&gt;

&lt;p&gt;In my opinion, an SLM is a model that can run fairly well without a GPU. It seems pretty simplistic but that is my general rule, which means that models that are 7 Billion parameters and under fit this rule today. &lt;/p&gt;

&lt;p&gt;As of today, models that are larger than 7B tend to run excruciatingly slowly even quantized without a GPU.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why use Small Language Models?
&lt;/h2&gt;

&lt;p&gt;There are many reasons to use SLMs:&lt;/p&gt;

&lt;p&gt;1) the most obvious - you don't need GPUs;&lt;/p&gt;

&lt;p&gt;2) they can be easily run on-prem, in private cloud, on a laptop, or in edge devices;&lt;/p&gt;

&lt;p&gt;3) they are more targeted and focused in scope of their training and are much easier to fine-tune; and&lt;/p&gt;

&lt;p&gt;4) they are easier to keep track of and audit.&lt;/p&gt;

&lt;p&gt;I can honestly add many more, but I will stop here because these are probably the most important ones.&lt;/p&gt;

&lt;p&gt;(I will add the caveat here that I am the founder of LLMWare, an open source project providing LLM-based application platform and over 60 SLMs in HuggingFace and that the example to follow uses LLMWare.)&lt;/p&gt;




&lt;p&gt;Here is a full end-to-end example of stacking 3 of popular Small Language Models (SLIM Extract, SLIM Summary and BLING Stable LM 3-B) along with 2 popular web services (Yahoo Finance and Wikipedia) to complete a financial research assignment with 30 different information keys, all on your laptop. &lt;/p&gt;




&lt;h2&gt;
  
  
  The Example Use Case: Combining 3 Different Models and 2 Web Services for Complex Financial Research
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Extracting key information from the source text using models.&lt;/li&gt;
&lt;li&gt;Performing secondary lookups using extracted information with web services like Yfinance for stock data and Wikipedia for company background information.&lt;/li&gt;
&lt;li&gt;Summarizing and structuring the extracted information into a comprehensive dictionary.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Models Used:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;slim-extract-tool&lt;/li&gt;
&lt;li&gt;slim-summary-tool&lt;/li&gt;
&lt;li&gt;bling-stablelm-3b-tool&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Web Services Used:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Yfinance for stock ticker information&lt;/li&gt;
&lt;li&gt;Wikipedia for company background information&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup and Imports
&lt;/h2&gt;

&lt;p&gt;First, let's import the necessary libraries and modules for our analysis.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from llmware.util import YFinance
from llmware.models import ModelCatalog
from llmware.parsers import WikiParser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Input Data
&lt;/h2&gt;

&lt;p&gt;Our input for this example is a financial news article about NIKE, Inc. We will extract and analyze information from this text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;text = ("_BEAVERTON, Ore.--(BUSINESS WIRE)--NIKE, Inc. (NYSE:NKE) today reported fiscal 2024 financial results for its "
        "third quarter ended February 29, 2024.) “We are making the necessary adjustments to drive NIKE’s next chapter "
        "of growth Post this Third quarter revenues were slightly up on both a reported and currency-neutral basis* "
        "at $12.4 billion NIKE Direct revenues were $5.4 billion, slightly up on a reported and currency-neutral basis "
        "NIKE Brand Digital sales decreased 3 percent on a reported basis and 4 percent on a currency-neutral basis "
        "Wholesale revenues were $6.6 billion, up 3 percent on a reported and currency-neutral basis Gross margin "
        "increased 150 basis points to 44.8 percent, including a detriment of 50 basis points due to restructuring charges "
        "Selling and administrative expense increased 7 percent to $4.2 billion, including $340 million of restructuring "
        "charges Diluted earnings per share was $0.77, including $0.21 of restructuring charges. Excluding these "
        "charges, Diluted earnings per share would have been $0.98* “We are making the necessary adjustments to "
        "drive NIKE’s next chapter of growth,” said John Donahoe, President &amp;amp; CEO, NIKE, Inc. “We’re encouraged by "
        "the progress we’ve seen, as we build a multiyear cycle of new innovation, sharpen our brand storytelling and "
        "work with our wholesale partners to elevate and grow the marketplace_.")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 1: Extract Information from Source Text
&lt;/h2&gt;

&lt;p&gt;We begin by loading the models and extracting key information from the source text. The keys we are interested in include the stock ticker, company name, total revenues, and more.&lt;/p&gt;

&lt;h1&gt;
  
  
  Load models
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ModelCatalog&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;load_model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;slim-extract-tool&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sample&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;model2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ModelCatalog&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;load_model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;slim-summary-tool&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sample&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max_output&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;model3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ModelCatalog&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;load_model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bling-stablelm-3b-tool&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sample&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;research_summary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="c1"&gt;# Extract information
&lt;/span&gt;&lt;span class="n"&gt;extract_keys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;stock ticker&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;company name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;total revenues&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;restructuring charges&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;digital growth&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ceo comment&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;quarter end date&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;extract_keys&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;function_call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;dict_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;_&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;dict_key&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm_response&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
        &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm_response&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;dict_key&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;research_summary&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="n"&gt;dict_key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Secondary Lookups Using Extracted Information
&lt;/h2&gt;

&lt;p&gt;With the extracted information, we perform secondary lookups using the YFinance web service to enrich our data with stock information, financial summaries, and company details.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;stock_ticker&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;research_summary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;ticker&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;research_summary&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;stock_ticker&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;ticker_core&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ticker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;# Adjusting ticker format if needed
&lt;/span&gt;
    &lt;span class="c1"&gt;# Fetch stock summary information from YFinance
&lt;/span&gt;    &lt;span class="n"&gt;yf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;YFinance&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;get_stock_summary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ticker&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ticker_core&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;yahoo finance stock info: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;yf&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Update research summary with financial data from YFinance
&lt;/span&gt;    &lt;span class="n"&gt;financial_keys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;current_stock_price&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;high_ltm&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;low_ltm&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;trailing_pe&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;forward_pe&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;volume&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;financial_keys&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;research_summary&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;yf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]})&lt;/span&gt;

    &lt;span class="c1"&gt;# Fetch detailed financial summary
&lt;/span&gt;    &lt;span class="n"&gt;yf2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;YFinance&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;get_financial_summary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ticker&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ticker_core&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;yahoo finance financial info - &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;yf2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;market_cap&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;price_to_sales&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;revenue_growth&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ebitda&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gross_margin&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;currency&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
        &lt;span class="n"&gt;research_summary&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;yf2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Use Extracted Company Name for Wikipedia Lookup
&lt;/h2&gt;

&lt;p&gt;Next, we use the extracted company name to fetch background information from Wikipedia. This includes a company overview, founding date, and other relevant details.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;company_name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;research_summary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;company_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;research_summary&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;company_name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;wiki_output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;WikiParser&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;add_wiki_topic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;company_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;target_results&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Extract and summarize company overview from Wikipedia
&lt;/span&gt;    &lt;span class="n"&gt;company_overview&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;text&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;block&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;wiki_output&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;blocks&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][:&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;summary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;function_call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;company_overview&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;company history (5)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;research_summary&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;summary&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm_response&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]})&lt;/span&gt;

    &lt;span class="c1"&gt;# Extract founding date and company description
&lt;/span&gt;    &lt;span class="n"&gt;founding_date_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;function_call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;company_overview&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;founding date&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;company_description_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;function_call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;company_overview&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;company description&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;research_summary&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;founding_date&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;founding_date_response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm_response&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;founding_date&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;company_description&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;company_description_response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm_response&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;company_description&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="c1"&gt;# Direct questions to the model about the company's business and products
&lt;/span&gt;    &lt;span class="n"&gt;business_overview_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;inference&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What is an overview of company&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s business?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;add_context&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;company_overview&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;origin_of_name_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;inference&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What is the origin of the company&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s name?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;add_context&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;company_overview&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;products_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;inference&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What are the product names&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;add_context&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;company_overview&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;research_summary&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;business_overview&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;business_overview_response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm_response&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;origin_of_name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;origin_of_name_response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm_response&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;products&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;products_response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;llm_response&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4: Completed Research - Summary Output
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;Finally&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;we&lt;/span&gt; &lt;span class="n"&gt;display&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;structured&lt;/span&gt; &lt;span class="n"&gt;research&lt;/span&gt; &lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;which&lt;/span&gt; &lt;span class="n"&gt;includes&lt;/span&gt; &lt;span class="nb"&gt;all&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;extracted&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;enriched&lt;/span&gt; &lt;span class="n"&gt;information&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Completed Research - Summary Output&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;item_counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;research_summary&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;items&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\t\t&lt;/span&gt;&lt;span class="s"&gt; -- &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;item_counter&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; - &lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s"&gt; - &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ljust&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; - &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;ljust&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;item_counter&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is a video of a tutorial if you are more of a visual learner:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/l0jzsg1_Ik0"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/llmware-ai/llmware" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;⭐️ Star LLMWare ⭐️&lt;/a&gt;
 &lt;/p&gt;

&lt;p&gt;Please be sure to visit our website &lt;a href="https://llmware.ai/" rel="noopener noreferrer"&gt;llmware.ai&lt;/a&gt; for more information and updates.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>Long Context Windows in LLMs are Deceptive (Lost in the Middle problem)🧐</title>
      <dc:creator>Namee</dc:creator>
      <pubDate>Wed, 20 Mar 2024 21:20:17 +0000</pubDate>
      <link>https://dev.to/llmware/why-long-context-windows-for-llms-can-be-deceptive-lost-in-the-middle-problem-oj2</link>
      <guid>https://dev.to/llmware/why-long-context-windows-for-llms-can-be-deceptive-lost-in-the-middle-problem-oj2</guid>
      <description>&lt;p&gt;It seems like OpenAI and Anthropic have been in a battle of context windows for the better part of a year. &lt;/p&gt;

&lt;p&gt;In May of 2023, Anthropic breathlessly announced: "We've expanded Claude's context window from 9K to &lt;strong&gt;100K&lt;/strong&gt; tokens, corresponding to around 75,000 words!"&lt;/p&gt;

&lt;p&gt;(Note: 75,000 words are about 300 pages)&lt;/p&gt;

&lt;p&gt;Not to be outdone, OpenAI released its &lt;strong&gt;128K&lt;/strong&gt; context window in November 2023.&lt;/p&gt;

&lt;p&gt;Only then to be outnumbered by Anthropic's &lt;strong&gt;200k&lt;/strong&gt; context window in March 2024.&lt;/p&gt;

&lt;p&gt;Is this back and forth tennis match for context window sizes really necessary?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/sI41tjGpDvxzXRJq3Q/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/sI41tjGpDvxzXRJq3Q/giphy.gif"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What are context windows?
&lt;/h2&gt;

&lt;p&gt;A context window is the text range around a target token (a token is about a word) that an LLM can process at the time the information is generated.&lt;/p&gt;

&lt;p&gt;People assume that the larger the context window, the more text that can be input to search, for example. &lt;/p&gt;

&lt;p&gt;However, long context windows in LLMs are misleading because many users assume that you don't need RAG if the context windows are big enough. &lt;/p&gt;




&lt;h2&gt;
  
  
  Lost in the Middle Problem
&lt;/h2&gt;

&lt;p&gt;Studies and experiments, however, have shown that long context windows in LLMs provide challenges when looking for a specific fact or text.&lt;/p&gt;

&lt;p&gt;The most vivid illustration of this problem for me showed up in this YouTube video.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/mWrivekFZMM"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;

&lt;p&gt;Here, the experimenter uses a context length of only 2k tokens (remember how GPT-4 has 128k token limit) to search for a simple sentence in the middle that reads: &lt;/p&gt;

&lt;p&gt;"Astrofield creates a normal understanding of non-celestial phenomena." &lt;/p&gt;

&lt;p&gt;And guess what? About &lt;strong&gt;2/3 of these models fail this test&lt;/strong&gt;! They literally can't find this sentence in only 2k tokens!&lt;/p&gt;
&lt;h2&gt;
  
  
  The Winners and Losers
&lt;/h2&gt;

&lt;p&gt;🏆 Here is the list of the models that &lt;strong&gt;passed&lt;/strong&gt; the 2k context window test: ChatGPT Turbo, Open Hermes 2.5 - Mistral 7B, Mistral 7b Instruct (passed once at 10:43 and failed once at 3:47), and Yi 34B Chat&lt;/p&gt;

&lt;p&gt;👎 Here is a list of the models that &lt;strong&gt;failed&lt;/strong&gt; the test: Mixtral 8x7B Instruct, Mistral Medium, Claude 2.0, GPT 4 Turbo, Gemini, Mistral 7B Instruct, Zephyr 7B Beta, PPIX 70B, Starling 7B - alpha, Llama 2 - 70B chat, Vicuna 33B and Mixtral 8x7B Instruct&lt;/p&gt;


&lt;h2&gt;
  
  
  Same Experiment with RAG
&lt;/h2&gt;

&lt;p&gt;Now a small disclaimer about me -- I am the founder of an open source project where we also make models in Hugging Face as well as a platform for LLM-based workflows called LLMWare.&lt;/p&gt;

&lt;p&gt;I was inspired to recreate this experiment so we made up a document of about 11,000 tokens (much more than the 2k) about astrophysics, added the sentence that is being queried "Astrofield creates a normal understanding of non-celestial phenomena" somewhere in the middle of the document and ran RAG on our LLMWare platform. &lt;/p&gt;

&lt;p&gt;We then tried this against 3 models - LLMWare BLING Tiny Llama 1.1B, LLMWare DRAGON Yi-6b, and also the Zephyr 7B Beta (which had failed the test in the YT video).&lt;/p&gt;

&lt;p&gt;Here are some screenshots of the results. As you can see, with RAG and fine-tuning, even a 1.1B model can find the answer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLMWare Bling Tiny Llama 1.1B:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finds this content with no problem. 💯&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnorl6mkrfowupqrch6xu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnorl6mkrfowupqrch6xu.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLMWare Dragon Yi 6B:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Also finds this content with no problem. 💯&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1jn19n09fx9ds7tgktu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1jn19n09fx9ds7tgktu.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Zephyr 7B Beta (not finetuned for RAG so a little more chatty but still finds it with RAG where it had failed before):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fid2k0b8mcwdbb0lyym9d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fid2k0b8mcwdbb0lyym9d.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  The Lesson: Large Context Windows are Ineffective at Searches
&lt;/h2&gt;

&lt;p&gt;As can be seen by our experiment, even the smallest 1B parameter model can do a better job than GPT-4 Turbo for fact-based searches with RAG. It is much better to use a small model with RAG than to rely on just a large (or in this case, not that large at just 2k tokens) context window IF it is coupled with the right RAG workflow.&lt;/p&gt;

&lt;p&gt;I hope this experimentation underscored the importance of a good LLM-based workflow using RAG. If you want to learn about RAG, here is an article I wrote recently in Dev.to to help you get started.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/llmware" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F8208%2F4bf5768d-460d-460b-9ccc-a80499ca040e.png" alt="LLMWare"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1161319%2F58d313f5-ca44-4c89-99d4-d0f859fab4ed.png" alt=""&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/llmware/become-a-rag-professional-in-2024-go-from-beginner-to-expert-41mg" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;🔥 How to Learn RAG in 2024: Go from Beginner to Expert (Step by Step) 🚀&lt;/h2&gt;
      &lt;h3&gt;Namee for LLMWare ・ Mar 4&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#programming&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#python&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#ai&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;So the next time someone tries to impress you with just a long context window, look critically at the surrounding workflow to make sure you are getting the answer you want.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/llmware-ai/llmware" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;Explore LLMWare on GitHub ⭐️&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Please join our LLMWare community on discord to learn more about RAG and LLMs! &lt;a href="https://discord.gg/5mx42AGbHm" rel="noopener noreferrer"&gt;https://discord.gg/5mx42AGbHm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please be sure to visit our website &lt;a href="https://llmware.ai/" rel="noopener noreferrer"&gt;llmware.ai&lt;/a&gt; for more information and updates.&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>🛠️How to Go from Software Engineer to AI Developer - What it means for YOU (Insider's View)🤖</title>
      <dc:creator>Namee</dc:creator>
      <pubDate>Sat, 09 Mar 2024 14:20:26 +0000</pubDate>
      <link>https://dev.to/noberst/go-from-software-to-ai-development-what-it-means-for-you-insiders-view-1fpk</link>
      <guid>https://dev.to/noberst/go-from-software-to-ai-development-what-it-means-for-you-insiders-view-1fpk</guid>
      <description>&lt;p&gt;I recently saw a lot of headlines that said Jensen Huang proclaims: 'Don't Teach Your Kids Programming.'  &lt;/p&gt;

&lt;p&gt;As we are hurtling toward an AI-dominant technocratic world, that was really shocking so I dug in a little more. What Jensen Huang actually said was:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"It is our job to create computing technology such that  NOBODY has to program."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's unpack this because it is so easy to read only the headlines and panic without actually thinking about what this means for YOU, the software developer, for TODAY (because you need to work to buy food to eat TODAY). &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/yoJC2K6rCzwNY2EngA/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/yoJC2K6rCzwNY2EngA/giphy.gif" width="500" height="313"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Software Development is a Completely Oversaturated Market
&lt;/h2&gt;

&lt;p&gt;I am the founder of an open source AI start-up called LLMWare. &lt;br&gt;
Every single day, without fail, I get at least 1 if not 3, emails or LinkedIn messages asking me if I need Software Developers. Name the region, price point, skill set. &lt;/p&gt;

&lt;p&gt;Starting as low as $5, in every country imaginable, I have been pitched some general software development service.&lt;/p&gt;

&lt;p&gt;What have I not been pitched yet? Credible AI Developers. &lt;/p&gt;

&lt;p&gt;Don't get me wrong -- almost everyone says they are experts in AI. But when I have interviewed some of these "experts," it was clear to me that they truly didn't know much about AI at all. &lt;/p&gt;

&lt;p&gt;(By the way, prompt engineering does not make you an AI expert. Long prompts have already been discredited because they produce inconsistent results so please don't waste time with "AI agents" that rely on the longest prompts of life.)&lt;/p&gt;

&lt;p&gt;But then I meet and talk to people everyday who want to build private Chatbots to incorporate into their companies to work with sensitive data. I hear all the time how clients can't find expert people to do real AI work. They are right - true AI experts are really hard to find.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/e5RffKbpWzmuZEFPUM/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/e5RffKbpWzmuZEFPUM/giphy.gif" width="440" height="248"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  There is a Huge Mismatch in Supply of Software vs. AI Developers
&lt;/h2&gt;

&lt;p&gt;So on the one hand, we have this mismatch of massive numbers of software developers who are looking for work (as is evidenced by the countless agencies who are driving down the price - supply and demand in action). Then on the other hand, I am talking to people who are asking for crazy amounts of money for even front-end developers IF they have some knowledge of AI!&lt;/p&gt;


&lt;h2&gt;
  
  
  You are Only a Hop, Skip and a Jump away from Changing Your Career
&lt;/h2&gt;

&lt;p&gt;And the craziest part of this from my perspective is that the journey from being a general Software Developer to an AI Developer is not that hard! It's not like you need to learn a special language or some other skill set. You just need PYTHON to get started!&lt;/p&gt;

&lt;p&gt;Moreover, there are so many resources out there to help you get started for FREE! We ourselves have put out a series of 7 videos to really teach you Retrieval Augmented Generation (RAG) so that you can learn the fundamental steps in a no BS way. Here is the first of these 7 videos to get started:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/uW3fElxcri4"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;

&lt;p&gt;And an article in dev.to with more details: &lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/llmware" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F8208%2F4bf5768d-460d-460b-9ccc-a80499ca040e.png" alt="LLMWare" width="430" height="435"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1161319%2F58d313f5-ca44-4c89-99d4-d0f859fab4ed.png" alt="" width="621" height="1344"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/llmware/become-a-rag-professional-in-2024-go-from-beginner-to-expert-41mg" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;🔥 How to Learn RAG in 2024: Go from Beginner to Expert (Step by Step) 🚀&lt;/h2&gt;
      &lt;h3&gt;Namee for LLMWare ・ Mar 4&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#programming&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#python&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#ai&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;





&lt;p&gt;And as with all things in life, these tools are going to help you change the trajectory of your life if you put in the work. Or, you can watch helplessly as your teammates and colleagues leap out of the gates with all this AI knowledge.&lt;/p&gt;

&lt;h2&gt;
  
  
  You are 100% Capable of Becoming an AI Developer
&lt;/h2&gt;

&lt;p&gt;Even more mind-blowing: If you are smart and dedicated enough to be currently making a living as a software developer, I guarantee that you are smart and dedicated enough to learn a few more skills to become an AI developer.&lt;/p&gt;

&lt;p&gt;Does this mean that you are going to start making millions of dollars a year to train models for OpenAI? Nope. BUT, I promise you that if you get started and truly grapple with this, based on the fact that you already know how to code, you can start to pivot your career to something that is much more relevant and in demand (meaning more $$$) in the near future.&lt;/p&gt;

&lt;p&gt;So back to Jensen Huang's recent quote. Do you want to be a part of the movement that makes it possible for people to interact with AI without coding? &lt;/p&gt;

&lt;p&gt;If YES, please get started. Ask questions. Experiment on your own time. Make the investment. &lt;/p&gt;

&lt;p&gt;I am seriously rooting for you. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExamZqMDN0NnpjODZyYWNqbndnY3htaHJmeWdkNTd1NTdsdXQ2dG9ldCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/3oEduLl7trWHEWdO5a/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExamZqMDN0NnpjODZyYWNqbndnY3htaHJmeWdkNTd1NTdsdXQ2dG9ldCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/3oEduLl7trWHEWdO5a/giphy.gif" width="325" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please check out our Github and leave a star! &lt;a href="https://github.com/llmware-ai/llmware" rel="noopener noreferrer"&gt;https://github.com/llmware-ai/llmware&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow us on discord here: &lt;a href="https://discord.gg/MgRaZz2VAB" rel="noopener noreferrer"&gt;https://discord.gg/MgRaZz2VAB&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please be sure to visit our website &lt;a href="https://llmware.ai/" rel="noopener noreferrer"&gt;llmware.ai&lt;/a&gt; for more information and updates.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>ai</category>
      <category>career</category>
    </item>
    <item>
      <title>🔥 How to Learn RAG in 2024: Go from Beginner to Expert (Step by Step) 🚀</title>
      <dc:creator>Namee</dc:creator>
      <pubDate>Mon, 04 Mar 2024 10:28:32 +0000</pubDate>
      <link>https://dev.to/llmware/become-a-rag-professional-in-2024-go-from-beginner-to-expert-41mg</link>
      <guid>https://dev.to/llmware/become-a-rag-professional-in-2024-go-from-beginner-to-expert-41mg</guid>
      <description>&lt;p&gt;Everyone seems to be worried about how AI can take away our jobs. &lt;/p&gt;

&lt;p&gt;But it is surprising how very few people have actually gotten into even the fundamental facets of working with AI models in a real practical setting.&lt;/p&gt;

&lt;p&gt;By now, most technical people have heard of RAG - Retrieval Augmented Generation. In simple terms, RAG is just a way to link documents or some knowledge source to AI models.&lt;/p&gt;

&lt;p&gt;Sounds easy enough if you're thinking of it with let's say 5 documents and ChatGPT. However, if you think about how anyone, or a company, would need to do this with thousands, tens of thousands, or millions of files, it is a different problem.&lt;/p&gt;

&lt;p&gt;This is an issue that almost all companies have. That is why I am a huge advocate for everyone having at least a foundational understanding of what RAG is, because it is one of the fundamental pieces of knowledge you need to work with AI models.&lt;/p&gt;




&lt;h2&gt;
  
  
  Upskill Your AI Knowledge in 2024
&lt;/h2&gt;

&lt;p&gt;This is what inspired us at LLMWare to create free step-by-step videos in YouTube that teach you the foundational elements of RAG, so that in 7 short videos (ranging from 8 to 15 min each), you can learn RAG. Note: Basic Python is a prerequisite.&lt;/p&gt;

&lt;p&gt;As with anything in life, if you take it seriously, this will be the launching point of becoming an AI expert. Even if you are not interested in becoming an AI expert, knowing how all the pieces of RAG works will definitely serve you well as many companies will be incorporating these workflows.&lt;/p&gt;




&lt;h2&gt;
  
  
  Ready to get started? Introduction
&lt;/h2&gt;

&lt;p&gt;This Introduction to RAG video walks you through the basic components of RAG so you can start your AI journey with LLMWare.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/uW3fElxcri4"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;1. Parsing, Text Chunking, Indexing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create your first library and get started with the basic steps. The documents in your library need to be parsed into a uniform format, and separated into smaller texts (chunking) then indexed with all the metadata. This video will walk you through this step.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/2xDefZ4oBOM"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;2. Build Embeddings&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What are embeddings, embedding models, vectors and vector databases? In this tutorial, learn the fundamental concepts behind embeddings, embedding models, vectors and vector databases.&lt;/p&gt;

&lt;p&gt;You will build your first embeddings with models from Hugging Face to store to a database and use these embeddings to run your queries.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/xQEk6ohvfV0"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;3. Prompt Models&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Learn how to prompt models by loading and prompting models from Hugging Face and OpenAI. &lt;/p&gt;

&lt;p&gt;Start inferencing models using this example and see how you can check if the model is providing the right answer using the context that was passed. Learn how to capture model's usage data such as token consumption, the output, and the total processing time.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/swiu4oBVfbA"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;4. RAG with Text Query&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With this video, you will start to search. We will be taking some form of knowledge in a library with embeddings and bring the pieces together with a model. &lt;/p&gt;

&lt;p&gt;Learn how to put together the right RAG strategy with a thoughtful retrieval and querying strategy combined with the right model to do the job.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/6oALi67HP7U"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;5. RAG with Semantic Query&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By now, you're really making progress. You are now ready to start semantic searching. Also known as natural language querying, this is where we reap the benefits of embeddings and vector databases. &lt;/p&gt;

&lt;p&gt;You will be able to query your knowledge base using natural language to ask questions to derive answers from even the most complex legal documents.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/XT4kIXA9H3Q"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;6. RAG with Multi-Step, Hybrid Query&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's Graduation Day! (If you have been following along this far). We will quickly recap through all that you have learned in the previous videos and learn how to use a quantized DRAGON-YI-6b-GGUF model from Hugging Face on a laptop.&lt;/p&gt;

&lt;p&gt;Perform multi-step hybrid queries to get the responses you need.&lt;/p&gt;

&lt;p&gt;Also learn how to perform evidence verification (guard against model hallucinations) and how to save all the output as JSON or CSV files for future datasets or audits.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/G1Q6Ar8THbo"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;

&lt;p&gt;Once you are all done with these videos, you are ready to dig in and play with all the really cool aspects of Generative AI, including building complex Agent workflows.&lt;/p&gt;

&lt;p&gt;Please check out our Github and leave a star! &lt;a href="https://github.com/llmware-ai/llmware" rel="noopener noreferrer"&gt;https://github.com/llmware-ai/llmware&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow us on discord here: &lt;a href="https://discord.gg/MgRaZz2VAB" rel="noopener noreferrer"&gt;https://discord.gg/MgRaZz2VAB&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please be sure to visit our website &lt;a href="https://llmware.ai/" rel="noopener noreferrer"&gt;llmware.ai&lt;/a&gt; for more information and updates.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>Easy RAG and LLM tutorials to learn how to get started to become an "AI Developer" (Beginner Friendly)</title>
      <dc:creator>Namee</dc:creator>
      <pubDate>Mon, 29 Jan 2024 12:26:19 +0000</pubDate>
      <link>https://dev.to/llmware/how-to-get-started-to-become-an-ai-developer-beginner-friendly-4067</link>
      <guid>https://dev.to/llmware/how-to-get-started-to-become-an-ai-developer-beginner-friendly-4067</guid>
      <description>&lt;p&gt;We have all heard stories of "AI" experts making hundreds of thousands to millions of dollars each year. As an example, the current pay at OpenAI is reported to be a total compensation package of US$916,000 for L5 engineers. &lt;/p&gt;

&lt;p&gt;It is estimated that there are 30 million developers, 300,000 Machine Learning engineers, and only 30,000 ML researchers in the world. &lt;/p&gt;

&lt;p&gt;Does that mean that only 1% of the developers in the world are qualified to be AI Developers? Do you need to be an expert in ML to qualify as an "AI Developer"?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbud826iaiccgh4be8oh3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbud826iaiccgh4be8oh3.png" alt="GEN AI Developer"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  You do NOT need to be an ML Expert to be a GEN AI Developer
&lt;/h2&gt;

&lt;p&gt;In a broad sense, because of the prevalence of Gen AI, almost every developer will in some sense interact with and use Gen AI in their job. Think of all the code generation apps and image generation apps you may already be using today.&lt;/p&gt;

&lt;p&gt;Even if you only use LLMs like ChatGPT and OpenAI APIs to help generate content, when dealing with a large amount of data, you will still need to learn how to automate workflows and to retrieve the right data to send to the LLMs.&lt;/p&gt;

&lt;p&gt;I have heard the argument that all developers will soon be AI developers in a general sense. But it will be difficult to command the pay rates that skilled AI Developers can command if you are a mere consumer of AI as opposed to being a skilled developer who can create and enable AI use cases and workflows.&lt;/p&gt;

&lt;p&gt;Using resources available for FREE, you can start to learn the fundamentals of Generative AI so that you too can become a skilled AI Developer.&lt;/p&gt;

&lt;p&gt;To get started in your AI Developer journey, here are the first steps to help you on your way. 👇&lt;/p&gt;

&lt;p&gt;(Remember that Rome wasn't built in one day. You have to start digging in to learn anything, right?) &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2lc5w46g4asv5ldnp64v.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2lc5w46g4asv5ldnp64v.gif" alt="Believe to Achieve"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Learn About RAG
&lt;/h2&gt;

&lt;p&gt;Retrieval Augmented Generation (RAG) is one of the fundamental aspects of Generative AI.  RAG is basically a short-hand way of describing the workflow of linking documents or knowledge to LLMs.  While this is foundational to using Gen AI in many enterprise workflows, many developers have not yet had first-hand experience with it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLMWare: Easy lessons in RAG for AI Beginners&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A little about me -- I am the founder of LLMWare. LLMWare is a RAG platform that is designed for both beginners and experts alike. &lt;/p&gt;

&lt;p&gt;In 'FAST-START: Learning RAG with LLMWare through 6 Examples', novice AI developers will learn the fundamentals of RAG in Python by:&lt;/p&gt;

&lt;p&gt;1) Creating your first library;&lt;/p&gt;

&lt;p&gt;2) Building embeddings (an embedding is a way of representing data as points in n-dimensional space so that similar data points cluster together);&lt;/p&gt;

&lt;p&gt;3) Learning how to use prompts and models;&lt;/p&gt;

&lt;p&gt;4) Text query using RAG;&lt;/p&gt;

&lt;p&gt;5) Semantic query using RAG (natural language querying for retrieval); and&lt;/p&gt;

&lt;p&gt;6) RAG with multi-step queries.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/llmware-ai/llmware" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;Explore LLMWare on GitHub ⭐️&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;In about an hour or two, you will have experimented with all of the basic components in RAG so that you will become familiar with how the pieces (like text parsing, chunking, indexing, vector databases, and LLMs) fit together in a very easy-to-use RAG workflow. &lt;/p&gt;

&lt;p&gt;Once you have passed the Fast-Start stage, there are over 50 'cut and paste' recipes to help you dive into the more advanced capabilities around RAG. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6exliu0pzveg7xh9g88b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6exliu0pzveg7xh9g88b.png" alt="RAG platform"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Learn about LLMs
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Hugging Face Tutorials on LLMs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you have learned about RAG, you will need to learn about models.&lt;/p&gt;

&lt;p&gt;There are significant benefits to using a pre-trained model. It reduces computation costs, your carbon footprint, and allows you to use state-of-the-art models without having to train one from scratch. &lt;/p&gt;

&lt;p&gt;Transformers provides access to thousands of pretrained models for a wide range of tasks. When you use a pretrained model, you train it on a dataset specific to your task. This is known as fine-tuning, an incredibly powerful training technique. &lt;/p&gt;

&lt;p&gt;In these tutorials, you will learn to fine-tune a pretrained model with a deep learning framework of your choice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fine-tune a pretrained model with 🤗 Transformers Trainer.&lt;/li&gt;
&lt;li&gt;Fine-tune a pretrained model in TensorFlow with Keras.&lt;/li&gt;
&lt;li&gt;Fine-tune a pretrained model in native PyTorch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://huggingface.co/docs/transformers/training" rel="noopener noreferrer"&gt;https://huggingface.co/docs/transformers/training&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Large Language Model Course by Maxime Labonne&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Maxime Labonne is currently a senior applied researcher at JPMorgan Chase who published a beloved open source library that teaches you the true nuts and bolts of LLMs. This is a comprehensive, deep-dive course that starts with the mathematics of Machine Learning (linear algebra, calculus and probability &amp;amp; statistics) all the way to Natural Language Processing.&lt;/p&gt;

&lt;p&gt;His LLM course is divided into three parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LLM Fundamentals covers essential knowledge about mathematics, Python, and neural networks.&lt;/li&gt;
&lt;li&gt;The LLM Scientist focuses on building the best possible LLMs using the latest techniques.&lt;/li&gt;
&lt;li&gt;The LLM Engineer focuses on creating LLM-based applications and deploying them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although this library is not going to be mastered in an afternoon, it is definitely worth checking out in detail if you want to truly take your AI skills to the next level.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mlabonne/llm-course" rel="noopener noreferrer"&gt;https://github.com/mlabonne/llm-course&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1pnx9dbx3r13gqr799l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1pnx9dbx3r13gqr799l.png" alt="llm-course"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;I hope you can use these resources to fast track your way to becoming an AI Developer in 2024.&lt;/p&gt;

&lt;p&gt;Please join our LLMWare community on discord! &lt;a href="https://discord.gg/5mx42AGbHm" rel="noopener noreferrer"&gt;https://discord.gg/5mx42AGbHm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please be sure to visit our website &lt;a href="https://llmware.ai/" rel="noopener noreferrer"&gt;llmware.ai&lt;/a&gt; for more information and updates.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>beginners</category>
      <category>ai</category>
    </item>
    <item>
      <title>📈 Top 5 Beginner-Friendly Open Source Libraries for RAG 🚀</title>
      <dc:creator>Namee</dc:creator>
      <pubDate>Sun, 21 Jan 2024 15:53:55 +0000</pubDate>
      <link>https://dev.to/llmware/top-5-beginner-friendly-open-source-libraries-for-rag-1mhb</link>
      <guid>https://dev.to/llmware/top-5-beginner-friendly-open-source-libraries-for-rag-1mhb</guid>
      <description>&lt;h1&gt;
  
  
  Introduction to RAG
&lt;/h1&gt;

&lt;p&gt;One of the most valuable skills you can learn today as a developer is learning how to build Retrieval Augmented Generation (RAG) applications using Large Language Models (LLMs).&lt;/p&gt;

&lt;h2&gt;
  
  
  Why?
&lt;/h2&gt;

&lt;p&gt;Because there are over 64 zettabytes of data in the world and this doesn't even include physical data like books or physical documents. (For your reference, 1 zettabyte is a trillion gigabytes.)&lt;/p&gt;

&lt;p&gt;Not only that, 90% percent of the world’s data was created in the last two years, and the volume of data is also doubling in size every two years. So basically, companies are swimming in mountains of data that is getting larger and larger by the day.&lt;/p&gt;

&lt;p&gt;How will companies access and use all this data?&lt;/p&gt;

&lt;p&gt;Everyone has by now heard of using Retrieval Augmented Generation (RAG) to find information with AI. Being able to access and use the ever-growing volumes of data is a key skill that every company needs.&lt;/p&gt;

&lt;p&gt;Even if you know that RAG is basically a short-hand way of describing the workflow of linking documents or knowledge to LLMs, many developers have not tried or experimented with this themselves (yet).&lt;/p&gt;

&lt;p&gt;The internet is full of lists of libraries but how to get started? &lt;/p&gt;

&lt;p&gt;Here is a short list of the best libraries to help you start with RAG.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. &lt;a href="https://github.com/llmware-ai/llmware" rel="noopener noreferrer"&gt;LLMWare&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;In LLMWare, you can upload documents, and with a few lines of code, start retrieving information. It handles the entire process that is required in RAG: document ingestion, parsing, chunking, indexing, embedding, storing to vector database, and linking to LLMs to retrieve the answer.&lt;/p&gt;

&lt;p&gt;LLMWare is designed to be integrated and end-to-end so all of these steps are accessible out of the box. It assembles all the pieces so you don't have to.&lt;/p&gt;

&lt;p&gt;LLMWare makes it very simple and easy to get started:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RAG workflow through end-to-end examples in just a few lines of code&lt;/li&gt;
&lt;li&gt;Create a library and load files seamlessly&lt;/li&gt;
&lt;li&gt;Generate embeddings effortlessly&lt;/li&gt;
&lt;li&gt;Conduct semantic searches with ease&lt;/li&gt;
&lt;li&gt;Utilize any Hugging Face model or a closed-source model like GPT-4 to answer questions from the data&lt;/li&gt;
&lt;li&gt;Examples include RAG with no-GPU-required models&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Disclaimer: I am the founder of LLMWare&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/llmware-ai/llmware" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;⭐️ Star LLMWare ⭐️&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdy22hfga9az7uol150ar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdy22hfga9az7uol150ar.png" alt="LLMWARE"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  2. &lt;a href="https://github.com/mongodb/mongo" rel="noopener noreferrer"&gt;MongoDB&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;MongoDB is a widely used, open-source NoSQL database program. It falls under the category of document-oriented databases, which means it stores and organizes data in a format similar to JSON documents. MongoDB is designed to be flexible and scalable, making it suitable for a variety of applications and industries.&lt;/p&gt;

&lt;p&gt;Databases, like MongoDB, are a very important step in RAG because they store information, including important metadata, that is extracted from the document or knowledge base, before embeddings.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mongodb/mongo" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;⭐️ Star MongoDB ⭐️&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fii6vl3tu41gfo6v3zt5g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fii6vl3tu41gfo6v3zt5g.png" alt="MongodbVector"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  3. &lt;a href="https://github.com/milvus-io/milvus" rel="noopener noreferrer"&gt;Milvus Vector DB&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;Milvus is an open-source vector database built to power embedding similarity search and AI applications. Milvus makes unstructured data search more accessible, and provides a consistent user experience regardless of the deployment environment.&lt;/p&gt;

&lt;p&gt;Milvus DB, or a similar vector DB, is a crucial step in RAG. It is where vector embeddings are stored for similarity searches. This database allows people to ask questions in natural language and retrieve related results. Without a good embedding and vector DB, the LLM models will not be able to receive the right chunks of text to read.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/milvus-io/milvus" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;⭐️ Star Milvus ⭐️&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl5t6jyfaidyfvxwd8nb7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl5t6jyfaidyfvxwd8nb7.png" alt="Milvus DB"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  4. &lt;a href="https://github.com/huggingface" rel="noopener noreferrer"&gt;Hugging Face&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;If you haven't visited Hugging Face, you really should. It is THE place to go for all open-source models and single-handedly saving the world from AI monopolies. Like Github is for open source Projects, Hugging Face is for open source Models. There are over 450,000 models, all FREE, for anyone who wants to use them. &lt;/p&gt;

&lt;p&gt;Hugging Face's Transformers Library is the Go-To library that&lt;br&gt;
provides thousands of pretrained models to perform tasks on different modalities such as text, vision, and audio.&lt;/p&gt;

&lt;p&gt;These models can be applied on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Text, for tasks like text classification, information extraction, question answering, summarization, translation, and text generation, in over 100 languages.&lt;/li&gt;
&lt;li&gt;Images, for tasks like image classification, object detection, and segmentation.&lt;/li&gt;
&lt;li&gt;Audio, for tasks like speech recognition and audio classification.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Transformer models can also perform tasks on several modalities combined, such as table question answering, optical character recognition, information extraction from scanned documents, video classification, and visual question answering.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/huggingface" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;⭐️ Star Hugging Face ⭐️&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpn47bs3bd97eu4gulkzb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpn47bs3bd97eu4gulkzb.png" alt="Hugging Face"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  5. &lt;a href="https://github.com/ggerganov/llama.cpp" rel="noopener noreferrer"&gt;Llama.cpp&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;No GPU? No problem!&lt;br&gt;
Llama.cpp to the rescue!&lt;/p&gt;

&lt;p&gt;The main goal of llama.cpp is to run the LLaMA model using 4-bit integer quantization on a MacBook.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Plain C/C++ implementation without dependencies&lt;/li&gt;
&lt;li&gt;Apple silicon first-class citizen - optimized via ARM NEON, Accelerate and Metal frameworks&lt;/li&gt;
&lt;li&gt;AVX, AVX2 and AVX512 support for x86 architectures&lt;/li&gt;
&lt;li&gt;Mixed F16 / F32 precision&lt;/li&gt;
&lt;li&gt;2-bit, 3-bit, 4-bit, 5-bit, 6-bit and 8-bit integer quantization support&lt;/li&gt;
&lt;li&gt;CUDA, Metal and OpenCL GPU backend support&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once quantized, larger models can be run on CPUs with very little performance loss. Look for GGUF versions of models to try with LLMWare or other RAG workflow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/ggerganov/llama.cpp" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;⭐️ Star Llama.cpp ⭐️&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvev1gzen7oolvnug4vfl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvev1gzen7oolvnug4vfl.png" alt="Llama.cpp"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;This is a VERY basic overview to get you started with RAG. If you want an integrated solution that is a one-stop shop for all of these libraries seamlessly working together, visit LLMWare's GitHub library to find over 50 great examples to help you get started.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://discord.gg/fCztJQeV7J" rel="noopener noreferrer"&gt;Find us in discord&lt;/a&gt; - we would love to hear from you!&lt;/p&gt;

&lt;p&gt;Please be sure to visit our website &lt;a href="https://llmware.ai/" rel="noopener noreferrer"&gt;llmware.ai&lt;/a&gt; for more information and updates.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
