llmware Framework

repository·main·Indexed 12 days ago

https://github.com/llmware-ai/llmware

A unified framework for building local, private, and secure LLM-based applications optimized for edge and on-device deployment. It features a Model Catalog with over 300 quantized models (including SLIM, BLING, and DRAGON series) and a RAG pipeline for document parsing, ingestion, and knowledge base creation. Supports various inferencing technologies including GGUF, OpenVINO, ONNXRuntime, and PyTorch across Windows, Mac, and Linux.

Tokens
46.7K
Snippets
144
Records
195
Agent score
93%

What's inside llmware

  1. Overview of llmware framework

    main

    llmware is a unified framework designed for building local, private, and secure knowledge-based LLM applications. It is optimized for AI PCs, laptops, edge devices, and self-hosted deployments across Windows, Mac, and Linux. The framework provides high-level interfaces to leverage various inferencing technologies like GGUF, OpenVINO, ONNXRuntime, ONNXRuntime-QNN (Qualcomm), WindowsLocalFoundry, and PyTorch.

    The framework consists of two primary components:

    1. Model Catalog: Contains over 300 models prepackaged in quantized and optimized formats. This includes 50+ specialized models (SLIM, Bling, Dragon, and Industry-Bert) for enterprise process automation, as well as support for major cloud models from OpenAI, Anthropic, and Google.
    2. RAG Pipeline: Provides integrated components for the full lifecycle of connecting knowledge sources to generative AI, including document parsing, ingestion, and scalable knowledge base creation.
  2. Overview of Lecture Tool features

    main

    The Lecture Tool is an AI application built on llmware designed to transcribe and analyze college lecture videos. Key capabilities include:

    • Library Management: Create Libraries to group and persistently store transcripts.
    • Transcription: Uses Whisper (integrated into llmware) to transcribe audio files into a Library.
    • Q&A: Ask general questions or specific questions regarding the lecture content.
    • Summarization: Generate summaries of lecture content.
    • Transcript Management: View all generated transcripts within the application.
  3. Parse various document types with LLMWare

    main

    LLMWare provides a unified parsing pipeline that handles unstructured content as the first step in a RAG (Retrieval-Augmented Generation) workflow. The framework supports parsing, text chunking, and indexing for a wide variety of file formats including:

    • Documents: PDF, PPTX, DOCX, XLSX, TXT, MD, HTML
    • Data: CSV, JSON, JSONL
    • Media: WAV (Voice), PNG, JPG (Images)
    • Web: Website/HTML extraction

    Parsing can be performed in-memory, saved to JSON files, or integrated directly into a Prompt without requiring a database.

  4. Compare Jupyter, Google Colab, and marimo notebooks

    main

    When working with llmware tutorials and notebooks, it is helpful to understand the different notebook environments available:

    Jupyter Notebooks

    An open-source web application for creating documents containing live code, equations, visualizations, and narrative text. It is typically run locally or on a server.

    Google Colab

    A cloud-hosted Jupyter notebook environment. It requires no local setup and provides free access to computing resources like GPUs and TPUs, making it ideal for machine learning tasks that require high compute power.

    marimo notebooks

    A modern open-source alternative to Jupyter. Key features include:

    • Reactive Execution: Unlike Jupyter, marimo understands the relationship between cells (similar to a spreadsheet) and automatically updates outputs when a dependency changes.
    • Interactive UI: Built-in interactive UI elements for data exploration.
    • Deployment: Notebooks can be deployed as interactive web apps or executed as standard Python scripts.

    Comparison Summary

    FeatureJupyterGoogle Colabmarimo
    EnvironmentLocal/ServerCloud-onlyLocal/Server
    ExecutionManual cell executionManual cell executionReactive/Automatic
    HardwareUser-providedFree GPUs/TPUsUser-provided
    Primary UseData Science/MLML with free GPUInteractive Apps/Scripts
  5. Overview of llmware Model Series

    main

    llmware provides several specialized model series optimized for different RAG and Agent workflows:

    • SLIM model series: Small, specialized models fine-tuned for function calling and multi-step, multi-model Agent workflows.
    • DRAGON model series: Production-grade RAG-optimized 6-9B parameter models.
    • BLING model series: Small CPU-based RAG-optimized, instruct-following 1B-5B parameter models.
    • Industry BERT models: Custom trained sentence transformer embedding models fine-tuned for Insurance, Contracts, Asset Management, and SEC.
    • GGUF Quantization: Many SLIM, DRAGON, and BLING models are available in gguf and tool versions, optimized for CPU deployment.
  6. What is an Agent in llmware?

    main

    In llmware, an Agent is defined as a multi-step, multi-model workflow designed to run entirely locally or in a self-hosted manner.

    Instead of a single monolithic LLM, llmware agents use small, specialized models as "tools" that are stacked together to build complex pipelines. This approach allows for enterprise process automation by integrating LLMs into private workflows safely, securely, and cost-effectively.

  7. Overview of llmware RAG-optimized model series

    main

    llmware provides several specialized model series designed for different RAG (Retrieval-Augmented Generation) and agentic workflows:

    • SLIM model series: Small, specialized models fine-tuned for function calling and multi-step, multi-model Agent workflows.
    • DRAGON model series: Production-grade RAG-optimized 6-7B parameter models.
    • BLING model series: Small, CPU-based, instruct-following 1B-3B parameter models optimized for RAG.
    • Industry BERT models: Custom trained sentence transformer embedding models fine-tuned for specific industries: Insurance, Contracts, Asset Management, and SEC.
    • GGUF Quantization: Many SLIM, DRAGON, and BLING models are available in gguf and tool versions, optimized for efficient CPU deployment.
  8. What are SLIM models and when to use them

    main

    SLIMs (Structured Language Instruction Models) are small, specialized LLMs (typically 1-3B parameters) designed to generate structured outputs such as Python dictionaries, lists, JSON, and SQL.

    They are optimized for:

    • Local Execution: Designed to run on a local CPU.
    • Agentic Workflows: They can be stacked together in multi-step, multi-model Agent workflows.
    • Programmatic Handling: Because they output structured data, they are ideal for tasks that need to be handled by code rather than just human-readable text.

    Each SLIM model is typically available in two versions:

    1. Pytorch/Huggingface FP16: The full-precision model.
    2. Quantized "tool": A version designed for fast inference on a CPU using LLMWare's embedded GGUF inference engine. It is recommended to start with the "tool" versions.
  9. Manage knowledge bases with Library

    main

    The Library class is used to ingest, organize, and index collections of knowledge. A library acts as a container for both text collection (database) resources and file resources.

    Workflow:

    1. Create: Initialize a new library using create_new_library(library_name).
    2. Ingest: Use add_files(path) to ingest a folder of mixed file types (pdf, pptx, docx, xlsx, txt, csv, md, json/jsonl, wav, png, jpg, html). Files are automatically parsed, chunked, and indexed.
    3. Embed: Install embeddings by calling install_new_embedding(embedding_model_name, vector_db, batch_size). You can install multiple embeddings (e.g., different models or different vector databases) on the same library.
    4. Inspect: Use get_library_card(library_name) to retrieve metadata or get_all_library_cards() to see all libraries.
    from llmware.library import Library
    
    # Create a library
    lib = Library().create_new_library("my_library")
    
    # Ingest files
    lib.add_files("/folder/path/to/my/files")
    
    # Install an embedding (e.g., using Milvus)
    lib.install_new_embedding(embedding_model_name="mini-lm-sbert", vector_db="milvus", batch_size=500)
    
    # Install a second embedding (e.g., using ChromaDB)
    lib.install_new_embedding(embedding_model_name="industry-bert-sec", vector_db="chromadb", batch_size=100)
    
    # Get metadata
    lib_card = Library().get_library_card("my_library")
  10. Manage knowledge bases using Library

    main

    A Library is a container for ingesting, organizing, and indexing knowledge. It manages both text collection (database) resources and file resources (stored in llmware_data/accounts/{library_name}).

    Workflow:

    1. Create: Use create_new_library(library_name) to initialize a new container.
    2. Ingest: Use add_files(path) to ingest a folder of mixed file types (pdf, pptx, docx, xlsx, txt, csv, md, json/jsonl, wav, png, jpg, html). Files are automatically routed to the correct parser, chunked, and indexed.
    3. Embed: Install embeddings using install_new_embedding(). You can mix and match different embedding models and vector databases (e.g., milvus, chromadb) within the same library.
    4. Inspect: Use get_library_card(library_name) to retrieve metadata (documents, chunks, images, tables, embeddings) or get_all_library_cards() to see all libraries.
    from llmware.library import Library
    
    # Create a library
    lib = Library().create_new_library("my_library")
    
    # Ingest files
    lib.add_files("/folder/path/to/my/files")
    
    # Install an embedding (e.g., using Milvus)
    lib.install_new_embedding(embedding_model_name="mini-lm-sbert", vector_db="milvus", batch_size=500)
    
    # Install a second embedding (e.g., using ChromaDB)
    lib.install_new_embedding(embedding_model_name="industry-bert-sec", vector_db="chromadb", batch_size=100)
    
    # Get metadata
    lib_card = Library().get_library_card("my_library")
  11. Understand the Library construct

    main

    A library serves as the 'knowledge-base container' in llmware. It manages two types of resources:

    1. Text collection (DB) resources: The searchable database of processed text.
    2. File resources: The physical files associated with the library, typically stored in a directory structure like llmware_data/accounts/{library_name}.