semvec/pypi-packages huggingface dataset:
llama-index-llms-groq 0.4.1
llama-index llms groq integration
Requires Python: <4.0,>=3.9

# LlamaIndex Llms Integration: Groq

Welcome to Groq! 🚀 At Groq, we've developed the world's first Language Processing Unit™, or LPU. The Groq LPU has a deterministic, single core streaming architecture that sets the standard for GenAI inference speed with predictable and repeatable performance for any given workload.

Beyond the architecture, our software is designed to empower developers like you with the tools you need to create innovative, powerful AI applications. With Groq as your engine, you can:

- Achieve uncompromised low latency and performance for real-time AI and HPC inferences 🔥
- Know the exact performance and compute time for any given workload 🔮
- Take advantage of our cutting-edge technology to stay ahead of the competition 💪

Want more Groq? Check out our [website](https://groq.com) for more resources and join our [Discord community](https://discord.gg/JvNsBDKeCG) to connect with our developers!

## Develop

To create a development environment, install poetry then run:

```bash
poetry install --with dev
```

## Testing

To test the integration, first enter the poetry venv:

```bash
poetry shell
```

Then tests can be run with make

```bash
make test
```

### Integration tests

Integration tests will be skipped unless an API key is provided. API keys can be created ath the [groq console](https://console.groq.com/keys).
Once created, store the API key in an environment variable and run tests

```bash
export GROQ_API_KEY=<your key here>
make test
```

## Linting and Formatting

Linting and code formatting can be executed with make.

```bash
make format
make lint
```
llama-index-retrievers-kendra 0.2.1
llama-index retrievers kendra integration
Requires Python: <4.0,>=3.9

# LlamaIndex Retrievers Integration: Amazon Kendra

## Overview

> [Amazon Kendra](https://aws.amazon.com/kendra/) is an intelligent search service powered by machine learning. Kendra reimagines enterprise search for your websites and applications by allowing users to search your unstructured and structured data using natural language.

> Kendra supports a wide variety of data sources including:
>
> - Documents (PDF, Word, PowerPoint, HTML)
> - FAQs
> - Knowledge bases
> - Databases
> - Websites
> - Custom data sources through connectors

## Installation

```bash
pip install llama-index-retrievers-kendra
```

## Usage

Here's a basic example of how to use the Kendra retriever:

```python
from llama_index.retrievers.kendra import AmazonKendraRetriever

retriever = AmazonKendraRetriever(
    index_id="<kendra-index-id>",
    query_config={
        "PageSize": 4,
        "AttributeFilter": {
            "EqualsTo": {
                "Key": "department",
                "Value": {"StringValue": "engineering"},
            }
        },
    },
)

query = "What is our company's remote work policy?"
retrieved_results = retriever.retrieve(query)

# Print the first retrieved result
print(retrieved_results[0].get_content())
```

## Advanced Configuration

The retriever supports Kendra's rich querying capabilities through the `query_config` parameter:

```python
retriever = AmazonKendraRetriever(
    index_id="<kendra-index-id>",
    query_config={
        "PageSize": 10,  # Number of results to return
        "AttributeFilter": {
            # Filter results based on document attributes
            "AndAllFilters": [
                {
                    "EqualsTo": {
                        "Key": "department",
                        "Value": {"StringValue": "engineering"},
                    }
                },
                {
                    "GreaterThan": {
                        "Key": "last_updated",
                        "Value": {"StringValue": "2023-01-01"},
                    }
                },
            ]
        },
        "QueryResultTypeFilter": "DOCUMENT",  # Only return document results
    },
)
```

## Confidence Scores

The retriever maps Kendra's confidence levels to float scores as follows:

- VERY_HIGH: 1.0
- HIGH: 0.8
- MEDIUM: 0.6
- LOW: 0.4
- NOT_AVAILABLE: 0.0

These scores can be accessed through the `score` attribute of the retrieved nodes:

```python
results = retriever.retrieve("query")
for result in results:
    print(f"Text: {result.get_content()}")
    print(f"Confidence Score: {result.score}")
```

## Authentication

The retriever supports various AWS authentication methods:

```python
retriever = AmazonKendraRetriever(
    index_id="<kendra-index-id>",
    profile_name="my-aws-profile",  # Use AWS profile
    region_name="us-west-2",  # Specify AWS region
    # Or use explicit credentials
    aws_access_key_id="YOUR_ACCESS_KEY",
    aws_secret_access_key="YOUR_SECRET_KEY",
    aws_session_token="YOUR_SESSION_TOKEN",  # Optional
)
```
llama-index-storage-chat-store-yugabytedb 0.1.1
llama-index storage-chat-store yugabytedb integration
Requires Python: <4.0,>=3.9

# LlamaIndex Chat_Store Integration: YugabyteDB Chat Store

## Prerequisites

Before using this integration, you'll need to have a YugabyteDB instance running. You can set up a local YugabyteDB instance by following the [YugaByteDB Quick Start Guide](https://docs.yugabyte.com/preview/quick-start/macos/).

## Installation

```shell
pip install llama-index-storage-chat-store-yugabytedb
```

## Usage

Using `YugabyteDBChatStore`, you can store your chat history remotely, without having to worry about manually persisting and loading the chat history.

```python
from llama_index.storage.chat_store.yugabytedb import YugabyteDBChatStore
from llama_index.core.memory import ChatMemoryBuffer

chat_store = YugabyteDBChatStore.from_uri(
    uri="yugabytedb+psycopg2://yugabyte:password@127.0.0.1:5433/yugabyte?load_balance=true",
)

chat_memory = ChatMemoryBuffer.from_defaults(
    token_limit=3000,
    chat_store=chat_store,
    chat_store_key="user1",
)
```

### Connection String Parameters

The connection string passed to `YugabyteDBChatStore.from_uri()` supports various parameters that can be used to configure the connection to your YugabyteDB cluster.
You can find a complete list of supported parameters in the [YugabyteDB psycopg2 Driver Documentation](https://docs.yugabyte.com/preview/drivers-orms/python/yugabyte-psycopg2/#step-2-set-up-the-database-connection).

The YugabyteDB specific parameters include:

- `load_balance`: Enable/disable load balancing (default: false)
- `topology_keys`: Specify preferred nodes for connection routing
- `yb_servers_refresh_interval`: Interval (in seconds) to refresh the list of available servers
- `fallback_to_topology_keys_only`: Whether to only connect to nodes specified in topology_keys
- `failed_host_ttl_seconds`: Time (in seconds) to wait before trying to connect to failed nodes
llama-index-readers-chroma 0.4.1
llama-index readers chroma integration
Requires Python: <4.0,>=3.10

# LlamaIndex Readers Integration: Chroma

## Overview

Chroma Reader is a tool designed to retrieve documents from existing persisted Chroma collections. Chroma is a framework for managing document collections and their associated embeddings efficiently.

### Installation

You can install Chroma Reader via pip:

```bash
pip install llama-index-readers-chroma
```

## Usage

```python
from llama_index.core.schema import Document
from llama_index.readers.chroma import ChromaReader

# Initialize ChromaReader with the collection name and optional parameters
reader = ChromaReader(
    collection_name="<Your Collection Name>",
    persist_directory="<Directory Path>",  # Optional: Directory where the collection is persisted
    chroma_api_impl="rest",  # Optional: Chroma API implementation (default: "rest")
    chroma_db_impl=None,  # Optional: Chroma DB implementation (default: None)
    host="localhost",  # Optional: Host for Chroma DB (default: "localhost")
    port=8000,  # Optional: Port for Chroma DB (default: 8000)
)

# Load data from Chroma collection
documents = reader.load_data(
    query_embedding=None,  # Provide query embedding if searching by embeddings
    limit=10,  # Number of results to retrieve
    where=None,  # Filter condition for metadata
    where_document=None,  # Filter condition for document
    query=["search term"],  # Provide query text if searching by text
)
```

This loader is designed to be used as a way to load data into
[LlamaIndex](https://github.com/run-llama/llama_index/tree/main/llama_index) and/or subsequently
used as a Tool in a [LangChain](https://github.com/hwchase17/langchain) Agent.
llama-index-readers-hubspot 0.4.1
llama-index readers hubspot integration
Requires Python: <4.0,>=3.9
Keywords: hubspot

# Hubspot Loader

```bash
pip install llama-index-readers-hubspot
```

This loader loads documents from Hubspot. The user specifies an access token to initialize the HubspotReader.

At the moment, this loader only supports access token authentication. To obtain an access token, you will need to create a private app by following instructions [here](https://developers.hubspot.com/docs/api/private-apps).

## Usage

Here's an example usage of the HubspotReader.

```python
import os

from llama_index.readers.hubspot import HubspotReader

reader = HubspotReader("<HUBSPOT_ACCESS_TOKEN>")
documents = reader.load_data()
```

This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).
llama-index-readers-weaviate 0.4.1
llama-index readers weaviate integration
Requires Python: <4.0,>=3.9

# LlamaIndex Readers Integration: Weaviate

## Overview

The Weaviate Reader retrieves documents from Weaviate through vector lookup. It allows you to specify a class name and properties to retrieve from documents, or to provide a custom GraphQL query. You can choose to receive separate Document objects per document or concatenate retrieved documents into one Document.

### Installation

You can install the Weaviate Reader via pip:

```bash
pip install llama-index-readers-weaviate
```

### Usage

```python
from llama_index.readers.weaviate import WeaviateReader

# Initialize WeaviateReader with host and optional authentication
reader = WeaviateReader(
    host="<Weaviate Host>", auth_client_secret="<Authentication Client Secret>"
)

# Load data from Weaviate
documents = reader.load_data(
    class_name="<Class Name>", properties=["property 1", "property 2"]
)
```

You can follow this tutorial to learn more on how to use [Weaviate Reader](https://docs.llamaindex.ai/en/stable/examples/data_connectors/WeaviateDemo/)

This loader is designed to be used as a way to load data into
[LlamaIndex](https://github.com/run-llama/llama_index/tree/main/llama_index) and/or subsequently
used as a Tool in a [LangChain](https://github.com/hwchase17/langchain) Agent.
llama-index-llms-sambanovasystems 0.5.1
llama-index llms sambanova cloud and sambastudio integration
Requires Python: <4.0,>=3.9

# LlamaIndex LLM Integration: SambaNova LLM

SambaNova Systems LLMs are custom LLMs (Language Models) interfaces that allow you to interact with AI models hosted on SambaNova's offerings - SambaNova Cloud and SambaStudio

## Key Features:

- Integration with SambaNova-hosted AI models
- Integration two SambaNova offerings - SambaNova Cloud and SambaStudio
- Support for completion based interactions
- Streaming support for completion responses
- Seamless integration with the LlamaIndex ecosystem

## Installation

```bash
pip install llama-index-llms-sambanovasystems
```

## Usage

```python
from llama_index.llms.sambanovasystems import SambaNovaCloud

SambaNovaCloud(
    sambanova_url="SambaNova cloud endpoint URL",
    sambanova_api_key="set with your SambaNova cloud API key",
    model="model name",
    context_window=100000,
)
```

## Usage

```python
from llama_index.llms.sambanovasystems import SambaStudio

SambaStudio(
    sambastudio_url="SambaStudio endpoint URL",
    sambastudio_api_key="set with your SambaStudio endppoint API key",
    model="model name",
    context_window=100000,
)
```
llama-index-tools-wikipedia 0.4.1
llama-index tools wikipedia integration
Requires Python: <4.0,>=3.9

# Wikipedia Tool

This tool fetches content from wikipedia and makes it available to the agent as a Tool. You can search for pages or load pages directly.

## Usage

This tool has more extensive example usage documented in a Jupyter notebook [here](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-wikipedia/examples/wikipedia.ipynb)

```python
from llama_index.tools.wikipedia import WikipediaToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

tool_spec = WikipediaToolSpec()

agent = FunctionAgent(
    tools=tool_spec.to_tool_list(), llm=OpenAI(model="gpt-4.1")
)

print(await agent.run("Who is Ben Afflecks spouse?"))
```

`load_data`: Loads a page from wikipedia
`search_data`: Searches wikipedia for a query and loads all matching pages

This loader is designed to be used as a way to load data as a Tool in a Agent.
See [this LlamaIndex tutorial][1] for examples.

[1]: https://gpt-index.readthedocs.io/en/stable/examples/index_structs/knowledge_graph/KnowledgeGraphIndex_vs_VectorStoreIndex_vs_CustomIndex_combined.html#load-data-from-wikipedia
llama-index-readers-kibela 0.4.1
llama-index readers kibela integration
Requires Python: <4.0,>=3.9

# Kibela Reader

```bash
pip install llama-index-readers-kibela
```

This reader fetches article from your [Kibela](https://kibe.la/) notes using the GraphQL API.

# Usage

Here's an example of how to use it. You can get your access token from [here](https://my.kibe.la/settings/access_tokens).

```python
import os
from llama_index.readers.kibela import KibelaReader

team = os.environ["KIBELA_TEAM"]
token = os.environ["KIBELA_TOKEN"]

reader = KibelaReader(team=team, token=token)
documents = reader.load_data()
```

Alternately, you can also use download_loader from llama_index

```python
import os

from llama_index.readers.kibela import KibelaReader

team = os.environ["KIBELA_TEAM"]
token = os.environ["KIBELA_TOKEN"]

reader = KibelaReader(team=team, token=token)
documents = reader.load_data()
```
llama-index-llms-llamafile 0.4.1
llama-index llms llamafile integration
Requires Python: <4.0,>=3.9

# LlamaIndex Llms Integration: llamafile

## Setup Steps

### 1. Download a LlamaFile

Use the following command to download a LlamaFile from Hugging Face:

```bash
wget https://huggingface.co/jartine/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/TinyLlama-1.1B-Chat-v1.0.Q5_K_M.llamafile
```

### 2. Make the File Executable

On Unix-like systems, run the following command:

```bash
chmod +x TinyLlama-1.1B-Chat-v1.0.Q5_K_M.llamafile
```

For Windows, simply rename the file to end with `.exe`.

### 3. Start the Model Server

Run the following command to start the model server, which will listen on `http://localhost:8080` by default:

```bash
./TinyLlama-1.1B-Chat-v1.0.Q5_K_M.llamafile --server --nobrowser --embedding
```

## Using LlamaIndex

If you are using Google Colab or want to interact with LlamaIndex, you will need to install the necessary packages:

```bash
%pip install llama-index-llms-llamafile
!pip install llama-index
```

### Import Required Libraries

```python
from llama_index.llms.llamafile import Llamafile
from llama_index.core.llms import ChatMessage
```

### Initialize the LLM

Create an instance of the LlamaFile LLM:

```python
llm = Llamafile(temperature=0, seed=0)
```

### Generate Completions

To generate a completion for a prompt, use the `complete` method:

```python
resp = llm.complete("Who is Octavia Butler?")
print(resp)
```

### Call Chat with a List of Messages

You can also interact with the LLM using a list of messages:

```python
messages = [
    ChatMessage(
        role="system",
        content="Pretend you are a pirate with a colorful personality.",
    ),
    ChatMessage(role="user", content="What is your name?"),
]
resp = llm.chat(messages)
print(resp)
```

### Streaming Responses

To use the streaming capabilities, you can call the `stream_complete` method:

```python
response = llm.stream_complete("Who is Octavia Butler?")
for r in response:
    print(r.delta, end="")
```

You can also stream chat responses:

```python
messages = [
    ChatMessage(
        role="system",
        content="Pretend you are a pirate with a colorful personality.",
    ),
    ChatMessage(role="user", content="What is your name?"),
]
resp = llm.stream_chat(messages)
for r in resp:
    print(r.delta, end="")
```

### LLM Implementation example

https://docs.llamaindex.ai/en/stable/examples/llm/llamafile/
llama-index-readers-memos 0.4.1
llama-index readers memos integration
Requires Python: <4.0,>=3.9
Keywords: memos, note

# Memos Loader

```bash
pip install llama-index-readers-memos
```

This loader fetches text from self-hosted [memos](https://github.com/usememos/memos).

## Usage

To use this loader, you need to specify the host where memos is deployed. If you need to filter, pass the [corresponding parameter](https://github.com/usememos/memos/blob/4fe8476169ecd2fc4b164a25611aae6861e36812/api/memo.go#L76) in `load_data`.

```python
from llama_index.readers.memos import MemosReader

loader = MemosReader("https://demo.usememos.com/")
documents = loader.load_data({"creatorId": 101})
```

This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).
llama-index-packs-zephyr-query-engine 0.5.1
llama-index packs zephyr_query_engine integration
Requires Python: <4.0,>=3.9
Keywords: engine, huggingface, index, local, query, zephyr

# Zephyr Query Engine Pack

Create a query engine using completely local and private models -- `HuggingFaceH4/zephyr-7b-beta` for the LLM and `BAAI/bge-base-en-v1.5` for embeddings.

## CLI Usage

You can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` python package:

```bash
llamaindex-cli download-llamapack ZephyrQueryEnginePack --download-dir ./zephyr_pack
```

You can then inspect the files at `./zephyr_pack` and use them as a template for your own project.

## Code Usage

You can download the pack to a the `./zephyr_pack` directory:

```python
from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
ZephyrQueryEnginePack = download_llama_pack(
    "ZephyrQueryEnginePack", "./zephyr_pack"
)

# You can use any llama-hub loader to get documents!
zephyr_pack = ZephyrQueryEnginePack(documents)
```

From here, you can use the pack, or inspect and modify the pack in `./zephyr_pack`.

The `run()` function is a light wrapper around `index.as_query_engine().query()`.

```python
response = zephyr_pack.run(
    "What did the author do growing up?", similarity_top_k=2
)
```

You can also use modules individually.

```python
# Use the llm
llm = zephyr_pack.llm
response = llm.complete("What is HuggingFace?")

# Use the index directly
index = zephyr_pack.index
query_engine = index.as_query_engine()
retriever = index.as_retriever()
```
llama-index-llms-meta 0.2.1
llama-index llms meta llama integration
Requires Python: <4.0,>=3.9

# LlamaIndex LLMs Integration: Llama API from Meta

## Installation

1. Install the required Python packages

   ```bash
   pip install llama-index-llms-meta
   pip install llama-index
   ```

2. Get API Key from [llama-api](https://llama.developer.meta.com?utm_source=partner-llamaindex&utm_medium=readme)

   ```bash
   export LLAMA_API_KEY=your_api_key
   ```

## Usage

### Basic Chat

To simulate a chat with multiple messages:

```python
from llama_index.core.llms import ChatMessage
from llama_index.llms.meta import LlamaLLM

messages = [
    ChatMessage(
        role="system", content="You are a pirate with a colorful personality"
    ),
    ChatMessage(role="user", content="What is your name"),
]
resp = LlamaLLM(
    model="Llama-3.3-8B-Instruct", api_key=os.environ["LLAMA_API_KEY"]
).chat(messages)
print(resp)
```

Example output (partial):

```
assistant: Yer lookin' fer me name, eh? Well, matey, me name be Captain Zephyr "Blackheart" McScurvy!
```

### Streaming Chat

For a streamed conversation, use `stream_chat`:

```python
from llama_index.core.llms import ChatMessage
from llama_index.llms.meta import LlamaLLM

messages = [
    ChatMessage(
        role="system", content="You are a pirate with a colorful personality"
    ),
    ChatMessage(role="user", content="What is your name"),
]

resp = LlamaLLM(
    model="Llama-3.3-8B-Instruct", api_key=os.environ["LLAMA_API_KEY"]
).stream_chat(messages)

for r in resp:
    print(r.delta, end="")
```

Example output (partial):

```
Yer lookin' fer me name, eh? Well, matey, me name be Captain Zephyr "Blackheart" McScurvy!
```
llama-index-readers-discord 0.4.1
llama-index readers discord integration
Requires Python: <4.0,>=3.9

# Discord Loader

```bash
pip install llama-index-readers-discord
```

This loader loads conversations from Discord. The user specifies `channel_ids` and we fetch conversations from
those `channel_ids`.

## Usage

Here's an example usage of the DiscordReader.

```python
import os

from llama_index.readers.discord import DiscordReader

discord_token = os.getenv("DISCORD_TOKEN")
channel_ids = [1057178784895348746]  # Replace with your channel_id
reader = DiscordReader(discord_token=discord_token)
documents = reader.load_data(channel_ids=channel_ids)
```

This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).
llama-index-readers-iceberg 0.4.1
llama-index readers iceberg integration
Requires Python: <4.0,>=3.9

# LlamaIndex Readers Integration: Iceberg

```bash
pip install llama-index-readers-iceberg
```

This loader fetches data from Apache Iceberg tables.

## Usage

To use this loader, you need to pass in an Intercom account access token.

```python
from llama_index.readers.iceberg import IcebergReader

docs = IcebergReader().load_data(
    profile_name="my_profile",
    region="us-west-2",
    namespace="my_dataset",
    table="my_table",
    metadata_columns=["_id", "_age", "_name"],
)
```

This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).
llama-index-llms-konko 0.4.1
llama-index llms konko integration
Requires Python: <4.0,>=3.9

# LlamaIndex Llms Integration: Konko

## Installation

1. Install the required Python packages:

   ```bash
   %pip install llama-index-llms-konko
   !pip install llama-index
   ```

2. Set the API keys as environment variables:

   ```bash
   export KONKO_API_KEY=<your-api-key>
   export OPENAI_API_KEY=<your-api-key>
   ```

## Usage

### Import Required Libraries

```python
import os
from llama_index.llms.konko import Konko
from llama_index.core.llms import ChatMessage
```

### Chat with Konko Model

To chat with a Konko model:

```python
os.environ["KONKO_API_KEY"] = "<your-api-key>"
llm = Konko(model="meta-llama/llama-2-13b-chat")
messages = ChatMessage(role="user", content="Explain Big Bang Theory briefly")

resp = llm.chat([messages])
print(resp)
```

### Chat with OpenAI Model

To chat with an OpenAI model:

```python
os.environ["OPENAI_API_KEY"] = "<your-api-key>"
llm = Konko(model="gpt-3.5-turbo")
message = ChatMessage(role="user", content="Explain Big Bang Theory briefly")

resp = llm.chat([message])
print(resp)
```

### Streaming Responses

To stream a response for longer messages:

```python
message = ChatMessage(role="user", content="Tell me a story in 250 words")
resp = llm.stream_chat([message], max_tokens=1000)

for r in resp:
    print(r.delta, end="")
```

### Complete with Prompt

To generate a completion based on a system prompt:

```python
llm = Konko(model="phind/phind-codellama-34b-v2", max_tokens=100)
text = """### System Prompt
You are an intelligent programming assistant.

### User Message
Implement a linked list in C++

### Assistant
..."""

resp = llm.stream_complete(text, max_tokens=1000)
for r in resp:
    print(r.delta, end="")
```

### LLM Implementation example

https://docs.llamaindex.ai/en/stable/examples/llm/konko/