forked from phoenix-oss/llama-stack-mirror
Add Chroma and PGVector adapters (#56)
Co-authored-by: Ashwin Bharambe <ashwin@meta.com>
This commit is contained in:
parent
5de6ed946e
commit
3f090d1975
8 changed files with 628 additions and 119 deletions
|
@ -6,7 +6,12 @@
|
|||
|
||||
from typing import List
|
||||
|
||||
from llama_toolchain.core.datatypes import Api, InlineProviderSpec, ProviderSpec
|
||||
from llama_toolchain.core.datatypes import * # noqa: F403
|
||||
|
||||
EMBEDDING_DEPS = [
|
||||
"blobfile",
|
||||
"sentence-transformers",
|
||||
]
|
||||
|
||||
|
||||
def available_memory_providers() -> List[ProviderSpec]:
|
||||
|
@ -14,12 +19,25 @@ def available_memory_providers() -> List[ProviderSpec]:
|
|||
InlineProviderSpec(
|
||||
api=Api.memory,
|
||||
provider_id="meta-reference-faiss",
|
||||
pip_packages=[
|
||||
"blobfile",
|
||||
"faiss-cpu",
|
||||
"sentence-transformers",
|
||||
],
|
||||
pip_packages=EMBEDDING_DEPS + ["faiss-cpu"],
|
||||
module="llama_toolchain.memory.meta_reference.faiss",
|
||||
config_class="llama_toolchain.memory.meta_reference.faiss.FaissImplConfig",
|
||||
),
|
||||
remote_provider_spec(
|
||||
api=Api.memory,
|
||||
adapter=AdapterSpec(
|
||||
adapter_id="chromadb",
|
||||
pip_packages=EMBEDDING_DEPS + ["chromadb-client"],
|
||||
module="llama_toolchain.memory.adapters.chroma",
|
||||
),
|
||||
),
|
||||
remote_provider_spec(
|
||||
api=Api.memory,
|
||||
adapter=AdapterSpec(
|
||||
adapter_id="pgvector",
|
||||
pip_packages=EMBEDDING_DEPS + ["psycopg2-binary"],
|
||||
module="llama_toolchain.memory.adapters.pgvector",
|
||||
config_class="llama_toolchain.memory.adapters.pgvector.PGVectorConfig",
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue