", "image": "https://jxnl.github.io/instructor/assets/images/social/blog/posts/aisummit-2023.png", "date_modified": "2024-03-12T02:46:20+00:00", "authors": [{"name": "jxnl"}], "tags": ["prompt engineering", "python", "talks", "video"]}, {"id": "https://jxnl.github.io/instructor/blog/2024/03/05/zero-cost-abstractions/", "url": "https://jxnl.github.io/instructor/blog/2024/03/05/zero-cost-abstractions/", "title": "Why Instructor is the Best Library for Structured LLM Outputs", "content_html": "
Why Instructor is the Best Library for Structured LLM Outputs
\n
Large language models (LLMs) like GPTs are incredibly powerful, but working with their open-ended text outputs can be challenging. This is where the Instructor library shines - it allows you to easily map LLM outputs to structured data using Python type annotations.
Instructor makes working with language models easy, but they are still computationally expensive.
\n
\n
Today, we're diving into optimizing instructor code while maintaining the excellent DX offered by Pydantic models. We'll tackle the challenges of caching Pydantic models, typically incompatible with pickle, and explore solutions that use decorators like functools.cache. Then, we'll craft custom decorators with diskcache and redis to support persistent caching and distributed systems.
Smarter Summaries w/ Finetuning GPT-3.5 and Chain of Density
\n
\n
Discover how to distil an iterative method like Chain Of Density into a single finetuned model using Instructor
\n
\n
In this article, we'll guide you through implementing the original Chain of Density method using Instructor, then show how to distile a GPT 3.5 model to match GPT-4's iterative summarization capabilities. Using these methods were able to decrease latency by 20x, reduce costs by 50x and maintain entity density.
\n
By the end you'll end up with a GPT 3.5 model, (fine-tuned using Instructor's great tooling), capable of producing summaries that rival the effectiveness of Chain of Density [Adams et al. (2023)]. As always, all code is readily available in our examples/chain-of-density folder in our repo for your reference.
Ensuring the accuracy of information is crucial. This blog post explores how Pydantic's powerful and flexible validators can enhance data accuracy through citation verification.
\n
We'll start with using a simple substring check to verify citations. Then we'll use instructor itself to power an LLM to verify citations and align answers with the given citations. Finally, we'll explore how we can use these techniques to generate a dataset of accurate responses.
I just released a free course on wits and biases. It goes over the material from [tutorial](../../tutorials/1-introducti...
", "image": "https://jxnl.github.io/instructor/assets/images/social/blog/posts/course.png", "date_modified": "2024-03-12T02:46:20+00:00", "authors": [{"name": "jxnl"}], "tags": ["open source"]}, {"id": "https://jxnl.github.io/instructor/blog/2023/10/17/enhancing-python-functions-with-instructor-a-guide-to-fine-tuning-and-distillation/", "url": "https://jxnl.github.io/instructor/blog/2023/10/17/enhancing-python-functions-with-instructor-a-guide-to-fine-tuning-and-distillation/", "title": "Enhancing Python Functions with Instructor: A Guide to Fine-Tuning and Distillation", "content_html": "
Enhancing Python Functions with Instructor: A Guide to Fine-Tuning and Distillation
\n
Introduction
\n
Get ready to dive deep into the world of fine-tuning task specific language models with Python functions. We'll explore how the instructor.instructions streamlines this process, making the task you want to distil more efficient and powerful while preserving its original functionality and backwards compatibility.
Latency is crucial, especially in eCommerce and newer chat applications like ChatGPT. Streaming is the solution that enables us to enhance the user experience without the need for faster response times.
Language models have seen significant growth. Using them effectively often requires complex frameworks. This post discusses how Instructor simplifies this process using Pydantic.
Its a common misconception that LangChain's LangSmith is only compatible with LangChain's models. In reality, LangSmith is a unified DevOps platform for developing, collaborating, testing, deploying, and monitoring LLM applications. In this blog we will explore how LangSmith can be used to enhance the OpenAI client alongside instructor.
", "image": "https://jxnl.github.io/instructor/assets/images/social/blog/posts/langsmith.png", "date_modified": "2024-03-12T02:46:20+00:00", "authors": [{"name": "jxnl"}], "tags": ["langsmith"]}, {"id": "https://jxnl.github.io/instructor/blog/2023/11/13/learn-async/", "url": "https://jxnl.github.io/instructor/blog/2023/11/13/learn-async/", "title": "Batch Processing OpenAI using asyncio and Instructor with Python", "content_html": "
Batch Processing OpenAI using asyncio and Instructor with Python
\n
Today, I will introduce you to various approaches for using asyncio in Python. We will apply this to batch process data using instructor and learn how to use asyncio.gather and asyncio.as_completed for concurrent data processing. Additionally, we will explore how to limit the number of concurrent requests to a server using asyncio.Semaphore.
", "image": "https://jxnl.github.io/instructor/assets/images/social/blog/posts/learn-async.png", "date_modified": "2024-03-12T02:46:20+00:00", "authors": [{"name": "jxnl"}], "tags": ["async", "async/await", "asyncio", "batch", "python"]}, {"id": "https://jxnl.github.io/instructor/blog/2024/03/07/open-source-local-structured-output-pydantic-json-openai/", "url": "https://jxnl.github.io/instructor/blog/2024/03/07/open-source-local-structured-output-pydantic-json-openai/", "title": "Structured Output for Open Source and Local LLMS", "content_html": "
Structured Output for Open Source and Local LLMS
\n
Originally, Instructor facilitated API interactions solely via the OpenAI SDK, with an emphasis on function call by incorporating Pydantic for structured data validation and serialization.
\n
As the year progressed, we expanded our toolkit by integrating JSON mode, thus enhancing our adaptability to vision models and open source models. This advancement now enables us to support an extensive range of models, from GPT and Mistral to virtually any model accessible through Ollama and Hugging Face, facilitated by llama-cpp-python. For more insights into leveraging JSON mode with various models, refer back to our detailed guide on Patching.
", "image": "https://jxnl.github.io/instructor/assets/images/social/blog/posts/open_source.png", "date_modified": "2024-03-12T02:46:20+00:00", "authors": [{"name": "jxnl"}], "tags": ["anyscale", "groq", "llama-cpp-python", "llms", "mistral", "ollama", "opensource", "together"]}, {"id": "https://jxnl.github.io/instructor/blog/2023/09/17/rag-is-more-than-just-embedding-search/", "url": "https://jxnl.github.io/instructor/blog/2023/09/17/rag-is-more-than-just-embedding-search/", "title": "RAG is more than just embedding search", "content_html": "
RAG is more than just embedding search
\n
With the advent of large language models (LLM), retrieval augmented generation (RAG) has become a hot topic. However throughout the past year of helping startups integrate LLMs into their stack I've noticed that the pattern of taking user queries, embedding them, and directly searching a vector store is effectively demoware.
\n
!!! note \"What is RAG?\"
\n
Retrieval augmented generation (RAG) is a technique that uses an LLM to generate responses, but uses a search backend to augment the generation. In the past year using text embeddings with a vector databases has been the most popular approach I've seen being socialized.\n
\n\n\n
So let's kick things off by examining what I like to call the 'Dumb' RAG Model\u2014a basic setup that's more common than you'd think.
What if your validation logic could learn and adapt like a human, but operate at the speed of software? This is the future of validation and it's already here.
\n
\n
Validation is the backbone of reliable software. But traditional methods are static, rule-based, and can't adapt to new challenges. This post looks at how to bring dynamic, machine learning-driven validation into your software stack using Python libraries like Pydantic and Instructor. We validate these outputs using a validation function which conforms to the structure seen below.
\n
python\ndef validation_function(value):\n if condition(value):\n raise ValueError(\"Value is not valid\")\n return mutation(value)
", "image": "https://jxnl.github.io/instructor/assets/images/social/blog/posts/validation-part1.png", "date_modified": "2024-03-12T02:46:20+00:00", "authors": [{"name": "jxnl"}, {"name": "ivanleomk"}], "tags": ["chain of thought", "citations", "constitutional ai", "guardrails", "pydantic", "validation"]}]}
\ No newline at end of file
diff --git a/feed_rss_created.xml b/feed_rss_created.xml
deleted file mode 100644
index e431e22d6..000000000
--- a/feed_rss_created.xml
+++ /dev/null
@@ -1 +0,0 @@
-InstructorA lightweight library for structured outputs with LLMs.https://jxnl.github.io/instructor/Jason Liuhttps://github.com/jxnl/instructor/enTue, 12 Mar 2024 02:47:04 -0000Tue, 12 Mar 2024 02:47:04 -00001440MkDocs RSS plugin - v1.12.1Simple Synthetic Data Generationjxnl<h1>Simple Synthetic Data Generation</h1><p>What that people have been using instructor for is to generate synthetic data rather than extracting data itself. We can ...</p>https://jxnl.github.io/instructor/blog/2024/03/08/simple-synthetic-data-generation/ Fri, 08 Mar 2024 00:00:00 +0000https://jxnl.github.io/instructor/blog/2024/03/08/simple-synthetic-data-generation/Structured Output for Open Source and Local LLMSjxnlanyscalegroqllama-cpp-pythonllmsmistralollamaopensourcetogether<h1>Structured Output for Open Source and Local LLMS</h1><p>Originally, Instructor facilitated API interactions solely via the OpenAI SDK, with an emphasis on function call by incorporating <a href="https://pydantic-docs.helpmanual.io/">Pydantic</a> for structured data validation and serialization. </p><p>As the year progressed, we expanded our toolkit by integrating <a href="../../concepts/patching.md#json-mode">JSON mode</a>, thus enhancing our adaptability to vision models and open source models. This advancement now enables us to support an extensive range of models, from <a href="https://openai.com/api/">GPT</a> and <a href="https://mistral.ai">Mistral</a> to virtually any model accessible through <a href="https://ollama.ai">Ollama</a> and <a href="https://huggingface.co/models">Hugging Face</a>, facilitated by <a href="../../hub/llama-cpp-python.md">llama-cpp-python</a>. For more insights into leveraging JSON mode with various models, refer back to our detailed guide on <a href="../../concepts/patching.md">Patching</a>.</p><p>If you want to check out a course on how to use Instructor with Pydantic, check out our course on <a href="https://www.wandb.courses/courses/steering-language-models">Steering language models towards structured outputs.</a>.</p>https://jxnl.github.io/instructor/blog/2024/03/07/open-source-local-structured-output-pydantic-json-openai/ Thu, 07 Mar 2024 00:00:00 +0000https://jxnl.github.io/instructor/blog/2024/03/07/open-source-local-structured-output-pydantic-json-openai/Why Instructor is the Best Library for Structured LLM Outputsjxnlllmspython<h1>Why Instructor is the Best Library for Structured LLM Outputs</h1><p>Large language models (LLMs) like GPTs are incredibly powerful, but working with their open-ended text outputs can be challenging. This is where the Instructor library shines - it allows you to easily map LLM outputs to structured data using Python type annotations.</p>https://jxnl.github.io/instructor/blog/2024/03/05/zero-cost-abstractions/ Tue, 05 Mar 2024 00:00:00 +0000https://jxnl.github.io/instructor/blog/2024/03/05/zero-cost-abstractions/Seamless Support with Langsmithjxnllangsmith<h1>Seamless Support with Langsmith</h1><p>Its a common misconception that LangChain's <a href="https://www.langchain.com/langsmith">LangSmith</a> is only compatible with LangChain's models. In reality, LangSmith is a unified DevOps platform for developing, collaborating, testing, deploying, and monitoring LLM applications. In this blog we will explore how LangSmith can be used to enhance the OpenAI client alongside <code>instructor</code>.</p>https://jxnl.github.io/instructor/blog/2024/02/18/seamless-support-with-langsmith/ Sun, 18 Feb 2024 00:00:00 +0000https://jxnl.github.io/instructor/blog/2024/02/18/seamless-support-with-langsmith/Free course on Weights and Biasesjxnlopen source<h1>Free course on Weights and Biases</h1><p>I just released a free course on wits and biases. It goes over the material from [tutorial](../../tutorials/1-introducti...</p>https://jxnl.github.io/instructor/blog/2024/02/14/weights-and-biases-course/ Wed, 14 Feb 2024 00:00:00 +0000https://jxnl.github.io/instructor/blog/2024/02/14/weights-and-biases-course/Introduction to Caching in Pythonjxnlcachingdiskcachefunctoolspythonredis<h1>Introduction to Caching in Python</h1><blockquote><p>Instructor makes working with language models easy, but they are still computationally expensive.</p></blockquote><p>Today, we're diving into optimizing instructor code while maintaining the excellent DX offered by <a href="https://docs.pydantic.dev/latest/">Pydantic</a> models. We'll tackle the challenges of caching Pydantic models, typically incompatible with <code>pickle</code>, and explore solutions that use <code>decorators</code> like <code>functools.cache</code>. Then, we'll craft custom decorators with <code>diskcache</code> and <code>redis</code> to support persistent caching and distributed systems.</p>https://jxnl.github.io/instructor/blog/2023/11/26/python-caching/ Sun, 26 Nov 2023 00:00:00 +0000https://jxnl.github.io/instructor/blog/2023/11/26/python-caching/Generators and LLM Streamingjxnlanmolgeneratorspythonstreaming<h1>Generators and LLM Streaming</h1><p>Latency is crucial, especially in eCommerce and newer chat applications like ChatGPT. Streaming is the solution that enables us to enhance the user experience without the need for faster response times.</p><p>And what makes streaming possible? Generators!</p>https://jxnl.github.io/instructor/blog/2023/11/26/python-generators-and-llm-streaming/ Sun, 26 Nov 2023 00:00:00 +0000https://jxnl.github.io/instructor/blog/2023/11/26/python-generators-and-llm-streaming/Verifying LLM Citations with Pydanticjxnlcitationsfinetuneinghallucinationpydanticvalidation<h1>Verifying LLM Citations with Pydantic</h1><p>Ensuring the accuracy of information is crucial. This blog post explores how Pydantic's powerful and flexible validators can enhance data accuracy through citation verification.</p><p>We'll start with using a simple substring check to verify citations. Then we'll use <code>instructor</code> itself to power an LLM to verify citations and align answers with the given citations. Finally, we'll explore how we can use these techniques to generate a dataset of accurate responses.</p>https://jxnl.github.io/instructor/blog/2023/11/18/validate-citations/ Sat, 18 Nov 2023 00:00:00 +0000https://jxnl.github.io/instructor/blog/2023/11/18/validate-citations/Batch Processing OpenAI using asyncio and Instructor with Pythonjxnlasyncasync/awaitasynciobatchpython<h1>Batch Processing OpenAI using <code>asyncio</code> and <code>Instructor</code> with Python</h1><p>Today, I will introduce you to various approaches for using asyncio in Python. We will apply this to batch process data using <code>instructor</code> and learn how to use <code>asyncio.gather</code> and <code>asyncio.as_completed</code> for concurrent data processing. Additionally, we will explore how to limit the number of concurrent requests to a server using <code>asyncio.Semaphore</code>.</p>https://jxnl.github.io/instructor/blog/2023/11/13/learn-async/ Mon, 13 Nov 2023 00:00:00 +0000https://jxnl.github.io/instructor/blog/2023/11/13/learn-async/Smarter Summaries w/ Finetuning GPT-3.5 and Chain of Densityivanleomkjxnlchain of densitydistillationfinetuneinggpt-3.5-turbopydanticvalidation<h1>Smarter Summaries w/ Finetuning GPT-3.5 and Chain of Density</h1><blockquote><p>Discover how to distil an iterative method like Chain Of Density into a single finetuned model using Instructor</p></blockquote><p>In this article, we'll guide you through implementing the original Chain of Density method using Instructor, then show how to distile a GPT 3.5 model to match GPT-4's iterative summarization capabilities. Using these methods were able to decrease latency by 20x, reduce costs by 50x and maintain entity density.</p><p>By the end you'll end up with a GPT 3.5 model, (fine-tuned using Instructor's great tooling), capable of producing summaries that rival the effectiveness of Chain of Density <a href="https://arxiv.org/abs/2309.04269">[Adams et al. (2023)]</a>. As always, all code is readily available in our <code>examples/chain-of-density</code> folder in our repo for your reference.</p>https://jxnl.github.io/instructor/blog/2023/11/05/chain-of-density/ Sun, 05 Nov 2023 00:00:00 +0000https://jxnl.github.io/instructor/blog/2023/11/05/chain-of-density/AI Engineer Keynote: Pydantic is all you needjxnlprompt engineeringpythontalksvideo<h1>AI Engineer Keynote: Pydantic is all you need</h1><p><a href="https://www.youtube.com/watch?v=yj-wSRJwrrc"><img alt="Pydantic is all you need" src="https://img.youtube.com/vi/yj-wSRJwrrc/0.jpg"></a></p><p><a href="https://www.youtube.com/watch?v=yj-wSRJwrrc">Click here to watch the full talk</a></p>https://jxnl.github.io/instructor/blog/2023/11/02/ai-engineer-keynote-pydantic-is-all-you-need/ Thu, 02 Nov 2023 00:00:00 +0000https://jxnl.github.io/instructor/blog/2023/11/02/ai-engineer-keynote-pydantic-is-all-you-need/Good LLM Validation is Just Good Validationjxnlivanleomkchain of thoughtcitationsconstitutional aiguardrailspydanticvalidation<h1>Good LLM Validation is Just Good Validation</h1><blockquote><p>What if your validation logic could learn and adapt like a human, but operate at the speed of software? This is the future of validation and it's already here.</p></blockquote><p>Validation is the backbone of reliable software. But traditional methods are static, rule-based, and can't adapt to new challenges. This post looks at how to bring dynamic, machine learning-driven validation into your software stack using Python libraries like <code>Pydantic</code> and <code>Instructor</code>. We validate these outputs using a validation function which conforms to the structure seen below.</p><p><code>pythondef validation_function(value): if condition(value): raise ValueError("Value is not valid") return mutation(value)</code></p>https://jxnl.github.io/instructor/blog/2023/10/23/good-llm-validation-is-just-good-validation/ Mon, 23 Oct 2023 00:00:00 +0000https://jxnl.github.io/instructor/blog/2023/10/23/good-llm-validation-is-just-good-validation/Enhancing Python Functions with Instructor: A Guide to Fine-Tuning and Distillationjxnldistillationfinetuningfunction callingpython<h1>Enhancing Python Functions with Instructor: A Guide to Fine-Tuning and Distillation</h1><h2>Introduction</h2><p>Get ready to dive deep into the world of fine-tuning task specific language models with Python functions. We'll explore how the <code>instructor.instructions</code> streamlines this process, making the task you want to distil more efficient and powerful while preserving its original functionality and backwards compatibility.</p><p>If you want to see the full example checkout <a href="https://github.com/jxnl/instructor/tree/main/examples/distilations">examples/distillation</a></p>https://jxnl.github.io/instructor/blog/2023/10/17/enhancing-python-functions-with-instructor-a-guide-to-fine-tuning-and-distillation/ Tue, 17 Oct 2023 00:00:00 +0000https://jxnl.github.io/instructor/blog/2023/10/17/enhancing-python-functions-with-instructor-a-guide-to-fine-tuning-and-distillation/RAG is more than just embedding searchjxnlEmbeddingsPersonal AssistantQuery UnderstandingRAGSearch Systems<h1>RAG is more than just embedding search</h1><p>With the advent of large language models (LLM), retrieval augmented generation (RAG) has become a hot topic. However throughout the past year of <a href="https://jxnl.co">helping startups</a> integrate LLMs into their stack I've noticed that the pattern of taking user queries, embedding them, and directly searching a vector store is effectively demoware.</p><p>!!! note "What is RAG?"</p><pre><code>Retrieval augmented generation (RAG) is a technique that uses an LLM to generate responses, but uses a search backend to augment the generation. In the past year using text embeddings with a vector databases has been the most popular approach I've seen being socialized.</code></pre><figure markdown> ![RAG](img/dumb_rag.png) <figcaption>Simple RAG that embedded the user query and makes a search.</figcaption></figure><p>So let's kick things off by examining what I like to call the 'Dumb' RAG Model—a basic setup that's more common than you'd think.</p>https://jxnl.github.io/instructor/blog/2023/09/17/rag-is-more-than-just-embedding-search/ Sun, 17 Sep 2023 00:00:00 +0000https://jxnl.github.io/instructor/blog/2023/09/17/rag-is-more-than-just-embedding-search/Generating Structured Output / JSON from LLMsjxnlIntroduction<h1>Generating Structured Output / JSON from LLMs</h1><p>Language models have seen significant growth. Using them effectively often requires complex frameworks. This post discusses how Instructor simplifies this process using Pydantic.</p>https://jxnl.github.io/instructor/blog/2023/09/11/generating-structured-output--json-from-llms/ Mon, 11 Sep 2023 00:00:00 +0000https://jxnl.github.io/instructor/blog/2023/09/11/generating-structured-output--json-from-llms/
\ No newline at end of file
diff --git a/feed_rss_updated.xml b/feed_rss_updated.xml
deleted file mode 100644
index fa69592a6..000000000
--- a/feed_rss_updated.xml
+++ /dev/null
@@ -1 +0,0 @@
-InstructorA lightweight library for structured outputs with LLMs.https://jxnl.github.io/instructor/Jason Liuhttps://github.com/jxnl/instructor/enTue, 12 Mar 2024 02:47:04 -0000Tue, 12 Mar 2024 02:47:04 -00001440MkDocs RSS plugin - v1.12.1AI Engineer Keynote: Pydantic is all you needjxnlprompt engineeringpythontalksvideo<h1>AI Engineer Keynote: Pydantic is all you need</h1><p><a href="https://www.youtube.com/watch?v=yj-wSRJwrrc"><img alt="Pydantic is all you need" src="https://img.youtube.com/vi/yj-wSRJwrrc/0.jpg"></a></p><p><a href="https://www.youtube.com/watch?v=yj-wSRJwrrc">Click here to watch the full talk</a></p>https://jxnl.github.io/instructor/blog/2023/11/02/ai-engineer-keynote-pydantic-is-all-you-need/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2023/11/02/ai-engineer-keynote-pydantic-is-all-you-need/Why Instructor is the Best Library for Structured LLM Outputsjxnlllmspython<h1>Why Instructor is the Best Library for Structured LLM Outputs</h1><p>Large language models (LLMs) like GPTs are incredibly powerful, but working with their open-ended text outputs can be challenging. This is where the Instructor library shines - it allows you to easily map LLM outputs to structured data using Python type annotations.</p>https://jxnl.github.io/instructor/blog/2024/03/05/zero-cost-abstractions/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2024/03/05/zero-cost-abstractions/Introduction to Caching in Pythonjxnlcachingdiskcachefunctoolspythonredis<h1>Introduction to Caching in Python</h1><blockquote><p>Instructor makes working with language models easy, but they are still computationally expensive.</p></blockquote><p>Today, we're diving into optimizing instructor code while maintaining the excellent DX offered by <a href="https://docs.pydantic.dev/latest/">Pydantic</a> models. We'll tackle the challenges of caching Pydantic models, typically incompatible with <code>pickle</code>, and explore solutions that use <code>decorators</code> like <code>functools.cache</code>. Then, we'll craft custom decorators with <code>diskcache</code> and <code>redis</code> to support persistent caching and distributed systems.</p>https://jxnl.github.io/instructor/blog/2023/11/26/python-caching/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2023/11/26/python-caching/Smarter Summaries w/ Finetuning GPT-3.5 and Chain of Densityivanleomkjxnlchain of densitydistillationfinetuneinggpt-3.5-turbopydanticvalidation<h1>Smarter Summaries w/ Finetuning GPT-3.5 and Chain of Density</h1><blockquote><p>Discover how to distil an iterative method like Chain Of Density into a single finetuned model using Instructor</p></blockquote><p>In this article, we'll guide you through implementing the original Chain of Density method using Instructor, then show how to distile a GPT 3.5 model to match GPT-4's iterative summarization capabilities. Using these methods were able to decrease latency by 20x, reduce costs by 50x and maintain entity density.</p><p>By the end you'll end up with a GPT 3.5 model, (fine-tuned using Instructor's great tooling), capable of producing summaries that rival the effectiveness of Chain of Density <a href="https://arxiv.org/abs/2309.04269">[Adams et al. (2023)]</a>. As always, all code is readily available in our <code>examples/chain-of-density</code> folder in our repo for your reference.</p>https://jxnl.github.io/instructor/blog/2023/11/05/chain-of-density/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2023/11/05/chain-of-density/Verifying LLM Citations with Pydanticjxnlcitationsfinetuneinghallucinationpydanticvalidation<h1>Verifying LLM Citations with Pydantic</h1><p>Ensuring the accuracy of information is crucial. This blog post explores how Pydantic's powerful and flexible validators can enhance data accuracy through citation verification.</p><p>We'll start with using a simple substring check to verify citations. Then we'll use <code>instructor</code> itself to power an LLM to verify citations and align answers with the given citations. Finally, we'll explore how we can use these techniques to generate a dataset of accurate responses.</p>https://jxnl.github.io/instructor/blog/2023/11/18/validate-citations/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2023/11/18/validate-citations/Free course on Weights and Biasesjxnlopen source<h1>Free course on Weights and Biases</h1><p>I just released a free course on wits and biases. It goes over the material from [tutorial](../../tutorials/1-introducti...</p>https://jxnl.github.io/instructor/blog/2024/02/14/weights-and-biases-course/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2024/02/14/weights-and-biases-course/Enhancing Python Functions with Instructor: A Guide to Fine-Tuning and Distillationjxnldistillationfinetuningfunction callingpython<h1>Enhancing Python Functions with Instructor: A Guide to Fine-Tuning and Distillation</h1><h2>Introduction</h2><p>Get ready to dive deep into the world of fine-tuning task specific language models with Python functions. We'll explore how the <code>instructor.instructions</code> streamlines this process, making the task you want to distil more efficient and powerful while preserving its original functionality and backwards compatibility.</p><p>If you want to see the full example checkout <a href="https://github.com/jxnl/instructor/tree/main/examples/distilations">examples/distillation</a></p>https://jxnl.github.io/instructor/blog/2023/10/17/enhancing-python-functions-with-instructor-a-guide-to-fine-tuning-and-distillation/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2023/10/17/enhancing-python-functions-with-instructor-a-guide-to-fine-tuning-and-distillation/Simple Synthetic Data Generationjxnl<h1>Simple Synthetic Data Generation</h1><p>What that people have been using instructor for is to generate synthetic data rather than extracting data itself. We can ...</p>https://jxnl.github.io/instructor/blog/2024/03/08/simple-synthetic-data-generation/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2024/03/08/simple-synthetic-data-generation/Generators and LLM Streamingjxnlanmolgeneratorspythonstreaming<h1>Generators and LLM Streaming</h1><p>Latency is crucial, especially in eCommerce and newer chat applications like ChatGPT. Streaming is the solution that enables us to enhance the user experience without the need for faster response times.</p><p>And what makes streaming possible? Generators!</p>https://jxnl.github.io/instructor/blog/2023/11/26/python-generators-and-llm-streaming/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2023/11/26/python-generators-and-llm-streaming/Generating Structured Output / JSON from LLMsjxnlIntroduction<h1>Generating Structured Output / JSON from LLMs</h1><p>Language models have seen significant growth. Using them effectively often requires complex frameworks. This post discusses how Instructor simplifies this process using Pydantic.</p>https://jxnl.github.io/instructor/blog/2023/09/11/generating-structured-output--json-from-llms/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2023/09/11/generating-structured-output--json-from-llms/Seamless Support with Langsmithjxnllangsmith<h1>Seamless Support with Langsmith</h1><p>Its a common misconception that LangChain's <a href="https://www.langchain.com/langsmith">LangSmith</a> is only compatible with LangChain's models. In reality, LangSmith is a unified DevOps platform for developing, collaborating, testing, deploying, and monitoring LLM applications. In this blog we will explore how LangSmith can be used to enhance the OpenAI client alongside <code>instructor</code>.</p>https://jxnl.github.io/instructor/blog/2024/02/18/seamless-support-with-langsmith/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2024/02/18/seamless-support-with-langsmith/Batch Processing OpenAI using asyncio and Instructor with Pythonjxnlasyncasync/awaitasynciobatchpython<h1>Batch Processing OpenAI using <code>asyncio</code> and <code>Instructor</code> with Python</h1><p>Today, I will introduce you to various approaches for using asyncio in Python. We will apply this to batch process data using <code>instructor</code> and learn how to use <code>asyncio.gather</code> and <code>asyncio.as_completed</code> for concurrent data processing. Additionally, we will explore how to limit the number of concurrent requests to a server using <code>asyncio.Semaphore</code>.</p>https://jxnl.github.io/instructor/blog/2023/11/13/learn-async/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2023/11/13/learn-async/Structured Output for Open Source and Local LLMSjxnlanyscalegroqllama-cpp-pythonllmsmistralollamaopensourcetogether<h1>Structured Output for Open Source and Local LLMS</h1><p>Originally, Instructor facilitated API interactions solely via the OpenAI SDK, with an emphasis on function call by incorporating <a href="https://pydantic-docs.helpmanual.io/">Pydantic</a> for structured data validation and serialization. </p><p>As the year progressed, we expanded our toolkit by integrating <a href="../../concepts/patching.md#json-mode">JSON mode</a>, thus enhancing our adaptability to vision models and open source models. This advancement now enables us to support an extensive range of models, from <a href="https://openai.com/api/">GPT</a> and <a href="https://mistral.ai">Mistral</a> to virtually any model accessible through <a href="https://ollama.ai">Ollama</a> and <a href="https://huggingface.co/models">Hugging Face</a>, facilitated by <a href="../../hub/llama-cpp-python.md">llama-cpp-python</a>. For more insights into leveraging JSON mode with various models, refer back to our detailed guide on <a href="../../concepts/patching.md">Patching</a>.</p><p>If you want to check out a course on how to use Instructor with Pydantic, check out our course on <a href="https://www.wandb.courses/courses/steering-language-models">Steering language models towards structured outputs.</a>.</p>https://jxnl.github.io/instructor/blog/2024/03/07/open-source-local-structured-output-pydantic-json-openai/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2024/03/07/open-source-local-structured-output-pydantic-json-openai/RAG is more than just embedding searchjxnlEmbeddingsPersonal AssistantQuery UnderstandingRAGSearch Systems<h1>RAG is more than just embedding search</h1><p>With the advent of large language models (LLM), retrieval augmented generation (RAG) has become a hot topic. However throughout the past year of <a href="https://jxnl.co">helping startups</a> integrate LLMs into their stack I've noticed that the pattern of taking user queries, embedding them, and directly searching a vector store is effectively demoware.</p><p>!!! note "What is RAG?"</p><pre><code>Retrieval augmented generation (RAG) is a technique that uses an LLM to generate responses, but uses a search backend to augment the generation. In the past year using text embeddings with a vector databases has been the most popular approach I've seen being socialized.</code></pre><figure markdown> ![RAG](img/dumb_rag.png) <figcaption>Simple RAG that embedded the user query and makes a search.</figcaption></figure><p>So let's kick things off by examining what I like to call the 'Dumb' RAG Model—a basic setup that's more common than you'd think.</p>https://jxnl.github.io/instructor/blog/2023/09/17/rag-is-more-than-just-embedding-search/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2023/09/17/rag-is-more-than-just-embedding-search/Good LLM Validation is Just Good Validationjxnlivanleomkchain of thoughtcitationsconstitutional aiguardrailspydanticvalidation<h1>Good LLM Validation is Just Good Validation</h1><blockquote><p>What if your validation logic could learn and adapt like a human, but operate at the speed of software? This is the future of validation and it's already here.</p></blockquote><p>Validation is the backbone of reliable software. But traditional methods are static, rule-based, and can't adapt to new challenges. This post looks at how to bring dynamic, machine learning-driven validation into your software stack using Python libraries like <code>Pydantic</code> and <code>Instructor</code>. We validate these outputs using a validation function which conforms to the structure seen below.</p><p><code>pythondef validation_function(value): if condition(value): raise ValueError("Value is not valid") return mutation(value)</code></p>https://jxnl.github.io/instructor/blog/2023/10/23/good-llm-validation-is-just-good-validation/ Tue, 12 Mar 2024 02:46:20 +0000https://jxnl.github.io/instructor/blog/2023/10/23/good-llm-validation-is-just-good-validation/
\ No newline at end of file
diff --git a/sitemap.xml.gz b/sitemap.xml.gz
index 02cf8a92a..a6e865ae8 100644
Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ