Andrejus Baranovski

Subscribe to Andrejus Baranovski feed
Blog about Oracle, Full Stack, Machine Learning and Cloud
Updated: 16 hours 25 min ago

Invoice Data Preprocessing for LLM

Mon, 2024-05-13 06:52
Data preprocessing is important step for LLM pipeline. I show various approaches to preprocess invoice data, before feeding it to LLM. This is quite challenging step, especially to preprocess tables. 


You Don't Need RAG to Extract Invoice Data

Mon, 2024-05-06 02:49
Documents like invoices or receipts can be processed by LLM directly, without RAG. I explain how you can do this locally with Ollama and Instructor. Thanks to Instructor, structured output from LLM can be validated with your own Pydantic class. 


LLM JSON Output with Instructor RAG and WizardLM-2

Mon, 2024-04-29 02:18
With Instructor library you can implement simple RAG without Vector DB or dependencies to other LLM libraries. The key RAG components - good data pre-processing and cleaning, powerful local LLM (such as WizardLM-2, Nous Hermes 2 PRO or Llama3) and Ollama or MLX backend.

Local RAG Explained with Unstructured and LangChain

Mon, 2024-04-22 03:01
In this tutorial, I do a code walkthrough and demonstrate how to implement the RAG pipeline using Unstructured, LangChain, and Pydantic for processing invoice data and extracting structured JSON data.


Local LLM RAG with Unstructured and LangChain [Structured JSON]

Mon, 2024-04-15 07:22
Using unstructured library to pre-process PDF document content, to be in a cleaner format. This helps LLM to produce more accurate response. JSON response is generated thanks to Nous Hermes 2 PRO LLM. Without any additional post-processing. Using Pydantic dynamic class to validate response to make sure it matches request. 


LlamaIndex Upgrade to 0.10.x Experience

Sun, 2024-03-31 09:11
I explain key points you should keep in mind when upgrading to LlamaIndex 0.10.x. 


LLM Structured Output for Function Calling with Ollama

Mon, 2024-03-25 09:40
I explain how function calling works with LLM. This is often confused concept, LLM doesn't call a function - LLM retuns JSON response with values to be used for function call from your environment. In this example I'm using Sparrow agent, to call a function. 


FastAPI File Upload and Temporary Directory for Stateless API

Sun, 2024-03-17 09:32
I explain how to handle file upload with FastAPI and how to process the file by using Python temporary directory. Files placed into temporary directory are automatically removed once request completes, this is very convenient for stateless API. 


Optimizing Receipt Processing with LlamaIndex and PaddleOCR

Sun, 2024-03-10 14:09
LlamaIndex Text Completion function allows to execute LLM request combining custom data and the question, without using Vector DB. This is very useful when processing output from OCR, it simplifies the RAG pipeline. In this video I explain, how OCR can be combined with LLM to process image documents in Sparrow.


LlamaIndex Multimodal with Ollama [Local LLM]

Sun, 2024-03-03 13:03
I describe how to run LlamaIndex Multimodal with local LlaVA LLM through Ollama. Advantage of this approach - you can process image documents with LLM directly, without running through OCR, this should lead to better results. This functionality is integrated as separate LLM agent into Sparrow. 


LLM Agents with Sparrow

Mon, 2024-02-26 01:53
I explain new functionality in Sparrow - LLM agents support. This means you can implement independently running agents, and invoke them from CLI or API. This makes it easier to run various LLM related processing within Sparrow. 


Extracting Invoice Structured Output with Haystack and Ollama Local LLM

Tue, 2024-02-20 02:49
I implemented Sparrow agent with Haystack structured output functionality to extract invoice data. This runs locally through Ollama, using LLM to retrieve key/value pairs data. 


Local LLM RAG Pipelines with Sparrow Plugins [Python Interface]

Sun, 2024-02-04 09:12
There are many tools and frameworks around LLM, evolving and improving daily. I added plugin support in Sparrow to run different pipelines through the same Sparrow interface. Each pipeline can be implemented with different tech (LlamaIndex, Haystack, etc.) and run independently. The main advantage is that you can test various RAG functionalities from a single app with a unified API and choose the one that works best in the specific use case. 


LLM Structured Output with Local Haystack RAG and Ollama

Mon, 2024-01-29 13:27
Haystack 2.0 provides functionality to process LLM output and ensure proper JSON structure, based on predefined Pydantic class. I show how you can run this on your local machine, with Ollama. This is possible thanks to OllamaGenerator class available from Haystack. 


JSON Output with Notus Local LLM [LlamaIndex, Ollama, Weaviate]

Tue, 2024-01-23 02:16
In this video, I show how to get JSON output from Notus LLM running locally with Ollama. JSON output is generated with LlamaIndex using the dynamic Pydantic class approach. 


FastAPI and LlamaIndex RAG: Creating Efficient APIs

Mon, 2024-01-15 03:21
FastAPI works great with LlamaIndex RAG. In this video, I show how to build a POST endpoint to execute inference requests for LlamaIndex. RAG implementation is done as part of Sparrow data extraction solution. I show how FastAPI can handle multiple concurrent requests to initiate RAG pipeline. I'm using Ollama to execute LLM calls as part of the pipeline. Ollama processes requests sequentially. It means Ollama will process API requests in the queue order. Hopefully, in the future, Ollama will support concurrent requests. 


Transforming Invoice Data into JSON: Local LLM with LlamaIndex & Pydantic

Mon, 2024-01-08 02:49
This is Sparrow, our open-source solution for document processing with local LLMs. I'm running local Starling LLM with Ollama. I explain how to get structured JSON output with LlamaIndex and dynamic Pydantic class. This helps to implement the use case of data extraction from invoice documents. The solution runs on the local machine, thanks to Ollama. I'm using a MacBook Air M1 with 8GB RAM. 


From Text to Vectors: Leveraging Weaviate for local RAG Implementation with LlamaIndex

Sun, 2023-12-17 07:59
Weaviate provides vector storage and plays an important part in RAG implementation. I'm using local embeddings from the Sentence Transformers library to create vectors for text-based PDF invoices and store them in Weaviate. I explain how integration is done with LlamaIndex to manage data ingest and LLM inference pipeline. 


Enhancing RAG: LlamaIndex and Ollama for On-Premise Data Extraction

Mon, 2023-12-11 06:54
LlamaIndex is an excellent choice for RAG implementation. It provides a perfect API to work with different data sources and extract data. LlamaIndex provides API for Ollama integration. This means we can easily use LlamaIndex with on-premise LLMs through Ollama. I explain a sample app where LlamaIndex works with Ollama to extract data from PDF invoices. 


Secure and Private: On-Premise Invoice Processing with LangChain and Ollama RAG

Tue, 2023-12-05 03:41
The Ollama desktop tool helps run LLMs locally on your machine. This tutorial explains how I implemented a pipeline with LangChain and Ollama for on-premise invoice processing. Running LLM on-premise provides many advantages in terms of security and privacy. Ollama works similarly to Docker; you can think of it as Docker for LLMs. You can pull and run multiple LLMs. This allows to switch between LLMs without changing RAG pipeline.