Skip to content

Commit

Permalink
Merge pull request #58 from SylphAI-Inc/li
Browse files Browse the repository at this point in the history
Li
  • Loading branch information
liyin2015 authored Jun 30, 2024
2 parents 53c8e71 + e708fb8 commit 7d16121
Show file tree
Hide file tree
Showing 12 changed files with 957 additions and 254 deletions.
68 changes: 68 additions & 0 deletions class_hierarchy_edges.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Component,ListParser
Component,JsonParser
Component,YamlParser
Component,ToolManager
Component,Prompt
Component,ModelClient
Component,Retriever
Component,FunctionTool
Component,Tokenizer
Component,Generator
Component,Embedder
Component,BatchEmbedder
Component,Sequential
Component,FunComponent
Component,ReActAgent
Component,OutputParser
Component,TextSplitter
Component,DocumentSplitter
Component,ToEmbeddings
Component,RetrieverOutputToContextStr
Component,DefaultLLMJudge
Component,LLMAugmenter
Generic,LocalDB
Generic,Retriever
Generic,GeneratorOutput
Generic,Parameter
Generic,Sample
Generic,Sampler
Generic,RandomSampler
Generic,ClassSampler
ModelClient,CohereAPIClient
ModelClient,TransformersClient
ModelClient,GroqAPIClient
ModelClient,GoogleGenAIClient
ModelClient,OpenAIClient
ModelClient,AnthropicAPIClient
Retriever,BM25Retriever
Retriever,PostgresRetriever
Retriever,RerankerRetriever
Retriever,LLMRetriever
Retriever,FAISSRetriever
Enum,DataClassFormatType
Enum,ModelType
Enum,DistanceToOperator
Enum,OptionalPackages
DataClass,EmbedderOutput
DataClass,GeneratorOutput
DataClass,RetrieverOutput
DataClass,FunctionDefinition
DataClass,Function
DataClass,FunctionExpression
DataClass,FunctionOutput
DataClass,StepOutput
DataClass,Document
DataClass,DialogTurn
DataClass,Instruction
DataClass,GeneratorStatesRecord
DataClass,GeneratorCallRecord
Generator,CoTGenerator
Generator,CoTGeneratorWithJsonOutput
OutputParser,YamlOutputParser
OutputParser,JsonOutputParser
OutputParser,ListOutputParser
OutputParser,BooleanOutputParser
Optimizer,BootstrapFewShot
Optimizer,LLMOptimizer
Sampler,RandomSampler
Sampler,ClassSampler
155 changes: 155 additions & 0 deletions docs/source/_static/class_hierarchy.html

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@
.theme-version {
display: none;
}
.bd-sidebar-primary {
width: 100%; /* Full width by default */
}

/* Adjust width for larger screens */
@media (min-width: 768px) { /* Example breakpoint for tablets and larger */
.bd-sidebar-primary {
width: 270px; /* Adjust the width for larger screens */
}
}

/* .copyright {
text-align: center;
} */
p {
font-size: 0.9em;
margin-bottom: 1.15rem;
Expand Down
2 changes: 1 addition & 1 deletion docs/source/developer_notes/base_data_class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Tensor wraps a multi-dimensional matrix to better support its operations and com
In LLM applications, data constantly needs to interact with LLMs in the form of strings via prompt and be parsed back to structured data from LLMs' text prediction.
:class:`core.base_data_class.DataClass` is designed to ease the data interaction with LLMs via prompt(input) and text prediction(output).

.. figure:: /_static/images/dataclass.png
.. figure:: ../_static/images/dataclass.png
:align: center
:alt: DataClass
:width: 680px
Expand Down
6 changes: 6 additions & 0 deletions docs/source/developer_notes/class_hierarchy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
LightRAG Class Hierarchy Visualization
=============================

.. raw:: html

<iframe src="../_static/class_hierarchy.html" width="100%" height="750px"></iframe>
2 changes: 1 addition & 1 deletion docs/source/developer_notes/evaluation.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
A Guideline on LLM Evaluation
LLM Evaluation
====================================

.. admonition:: Author
Expand Down
4 changes: 2 additions & 2 deletions docs/source/developer_notes/optimizer.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Optimizer - The Future of LLM applications
==========================================================
Optimizer
==========================================================
20 changes: 13 additions & 7 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,29 @@ It is light, modular, and robust.
return await self.generator.acall({"input_str": query})
qa = SimpleQA()
answer = qa("What is LightRAG?")
Clarity and Simplicity
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Developers who are building real-world Large Language Model (LLM) applications are the real heroes.
As a library, we provide them the foundamental building blocks with 100% clarity and simplicity.

We understand that developers building real-world Large Language Model (LLM) applications are the real heroes. Just like AI researchers and engineers who build models on top of PyTorch, developers require **Maximum Flexibility and Customizability**: Each developer has unique data needs to build their own models/components, experiment with In-context Learning (ICL) or model finetuning, and deploy the LLM applications to production. This means the library must provide fundamental lower-level building blocks and strive for clarity and simplicity:
.. We support them with require **Maximum Flexibility and Customizability**:
- We maintain no more than two levels of subclasses.
- Each core abstract class is designed to be robust and flexible.
- We use 10X less code than other libraries to achieve 10X more robustness and flexibility.
.. Each developer has unique data needs to build their own models/components, experiment with In-context Learning (ICL) or model finetuning, and deploy the LLM applications to production. This means the library must provide fundamental lower-level building blocks and strive for clarity and simplicity:
Here is the printed out structure of ``qa``:
- Two foundamental and powerful base classes: ``component`` for the pipeline and ``DataClass`` for the data interaction with LLMs.
- We end up with less than two levels of subclasses. :doc:`developer_notes/class_hierarchy`.
- The result is a library with bare minimum abstraction with maximum flexibility and customizability.

.. - We use 10X less code than other libraries to achieve 10X more robustness and flexibility.
.. - `Class Hierarchy Visualization <developer_notes/class_hierarchy.html>`_
Similar to PyTorch module, our ``component`` gives us a great visualization on the pipeline structure.

.. code-block::
Expand Down
Loading

0 comments on commit 7d16121

Please sign in to comment.