semvec/pypi-packages huggingface dataset:
llama-index-node-parser-topic 0.3.1
llama-index node_parser topic node parser integration
Requires Python: <4.0,>=3.9

# LlamaIndex Node_Parser Integration: TopicNodeParser

Implements the topic node parser described in the paper [MedGraphRAG](https://arxiv.org/html/2408.04187), which aims to improve the capabilities of LLMs in the medical domain by generating evidence-based results through a novel graph-based Retrieval-Augmented Generation framework, improving safety and reliability in handling private medical data.

`TopicNodeParser` implements an approximate version of the chunking technique described in the paper.

Here is the technique as outlined in the paper:

```
Large medical documents often contain multiple themes or diverse content. To process these effectively, we first segment the document into data chunks that conform to the context limitations of Large Language Models (LLMs). Traditional methods such as chunking based on token size or fixed characters typically fail to detect subtle shifts in topics accurately. Consequently, these chunks may not fully capture the intended context, leading to a loss in the richness of meaning.

To enhance accuracy, we adopt a mixed method of character separation coupled with topic-based segmentation. Specifically, we utilize static characters (line break symbols) to isolate individual paragraphs within the document. Following this, we apply a derived form of the text for semantic chunking. Our approach includes the use of proposition transfer, which extracts standalone statements from a raw text Chen et al. (2023). Through proposition transfer, each paragraph is transformed into self-sustaining statements. We then conduct a sequential analysis of the document to assess each proposition, deciding whether it should merge with an existing chunk or initiate a new one. This decision is made via a zero-shot approach by an LLM. To reduce noise generated by sequential processing, we implement a sliding window technique, managing five paragraphs at a time. We continuously adjust the window by removing the first paragraph and adding the next, maintaining focus on topic consistency. We set a hard threshold that the longest chunk cannot excess the context length limitation of LLM. After chunking the document, we construct graph on each individual of the data chunk.
```

## Installation

```
pip install llama-index-node-parser-topic
```

## Usage

```python
from llama_index.core import Document
from llama_index.node_parser.topic import TopicNodeParser

node_parser = TopicNodeParser.from_defaults(
    llm=llm,
    max_chunk_size=1000,
    similarity_method="llm",  # can be "llm" or "embedding"
    # embed_model=embed_model,  # used for "embedding" similarity_method
    # similarity_threshold=0.8,  # used for "embedding" similarity_method
    window_size=2,  # paper suggests window_size=5
)

nodes = node_parser(
    [
        Document(text="document text 1"),
        Document(text="document text 2"),
    ],
)
```
llama-index-tools-elevenlabs 0.2.1
llama-index tools elevenlabs integration
Requires Python: <4.0,>=3.9

# Elevenlabs.io Tool

This tool allows Agents to use Elevenlabs.io text-to-speech to create audio files from text. To see more and get started, visit https://elevenlabs.io/

## Usage

This tool has a 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-elevenlabs/examples/elevenlabs_speech.ipynb)

```python
from llama_index.tools.elevenlabs import ElevenLabsToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

speech_tool = ElevenLabsToolSpec(api_key="your-key")

agent = FunctionAgent(
    tools=speech_tool.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)
print(
    await agent.run(
        'Create speech from the following text "Hello world!" and output the file to "speech.wav"'
    )
)
```

`text_to_speech`: Takes an input string and synthesizes audio to play on the users computer
`get_voices`: Lists the dumped Pydantic models for all available elevenlabs.io voices

This loader is designed to be used as a way to load data as a Tool in a Agent.
llama-index-readers-couchdb 0.4.1
llama-index readers couchdb integration
Requires Python: <4.0,>=3.9

# CouchDB Loader

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

This loader loads documents from CouchDB. The loader currently supports CouchDB 3.x
using the CouchDB3 python wrapper from https://github.com/n-vlahovic/couchdb3
The user specifies a CouchDB instance to initialize the reader. They then specify
the database name and query params to fetch the relevant docs.

## Usage

Here's an example usage of the SimpleCouchDBReader.

```python
import os

from llama_index.readers.couchdb import SimpleCouchDBReader

host = "<host>"
port = "<port>"
db_name = "<db_name>"
# query is passed into db.find()
query_str = "{ couchdb_find_sytax_json }"
reader = SimpleCouchDBReader(host, port)
documents = reader.load_data(db_name, query=query_str)
```

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

# Python File Tool

This tool loads a python file and extracts function names, arguments and descriptions automatically. This tool is particular useful for automatically creating custom Tool Specs when you already have well documented python functions.

## Usage

This tool has more extensive example usage documented in a Jupyter notebook [here](https://github.com/emptycrown/llama-hub/tree/main/llama_hub/tools/notebooks/create_a_tool.ipynb)

Here's an example usage of the PythonFileToolSpec.

```python
from llama_index.tools.python_file import PythonFileToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

pyfile = PythonFileToolSpec("./numpy_linalg.py")

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

print(
    await agent.run(
        """Load the eig, transpose and solve functions from the python file,
and then write a function definition using only builtin python types (List, float, Tuple)
with a short 5-10 line doc string tool prompts for the functions that only has a small description and arguments
"""
    )
)
```

`function_definitions`: Get all of the function definitions from the Python file
`get_function`: Get a specific function definition from the Python file
`get_functions`: Get a list of functions from the python file

This loader is designed to be used as a way to load data as a Tool in a Agent.
llama-index-llms-azure-inference 0.5.1
Integration for model supporting Azure AI model inference API in llama-index
Requires Python: <4.0,>=3.9

# LlamaIndex LLMs Integration: Azure AI model inference

The integration package `llama-index-llms-azure-inference` brings support for language models deployed in Azure AI, including Azure AI studio and Azure Machine Learning, to the `llama_index` ecosystem. Any model endpoint supporting the [Azure AI model inference API](https://aka.ms/azureai/modelinference) can be used with this integration.

For details and examples about how to use this integration, see [Getting starting with LlamaIndex and Azure AI](https://aka.ms/azureai/llamaindex).

## Changelog

- **0.2.4**:

  - Introduce `api_version` parameter in the `AzureAICompletionsModel` class to allow overriding of the default value.
  - Introduce support for [Azure AI model inference service](https://aka.ms/aiservices/infernece) which requires `azure-ai-inference>=1.0.0b5`.
llama-index-postprocessor-colpali-rerank 0.3.1
llama-index postprocessor colpali-rerank integration
Requires Python: <4.0,>=3.9

# LlamaIndex Postprocessor Integration: ColPali Rerank

[ColPali](https://huggingface.co/vidore/colpali-v1.2): ColPali it is a model based on a novel model architecture and training strategy based on Vision Language Models (VLMs), to efficiently index documents from their visual features.

Please `pip install llama-index-postprocessor-colpali-rerank` to install ColPali Rerank package.
llama-index-readers-opensearch 0.4.1
llama-index readers opensearch integration
Requires Python: <4.0,>=3.9

# Opensearch Loader

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

The Opensearch Loader returns a set of texts corresponding to documents retrieved from an Opensearch index.
The user initializes the loader with an Opensearch index. They then pass in a field, and optionally a JSON query DSL object to fetch the fields they want.

## Usage

Here's an example usage of the OpensearchReader to load 100 documents.

```python
from llama_index.readers.opensearch import OpensearchReader

reader = OpensearchReader(
    host="localhost",
    port=9200,
    index="<index_name>",
    basic_auth=("<user_name>", "<password>"),
)

query = {"size": 100, "query": {"match_all": {}}}
documents = reader.load_data(
    "<field_name>", query=query, embedding_field="field_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-embeddings-zhipuai 0.3.1
llama-index embeddings zhipuai integration
Requires Python: <4.0,>=3.9

# LlamaIndex Embeddings Integration: ZhipuAI

### Installation

```bash
%pip install llama-index-embeddings-zhipuai
!pip install llama-index
```

### Basic usage

```py
# Import ZhipuAI
from llama_index.embeddings.zhipuai import ZhipuAIEmbedding

embedding = ZhipuAIEmbedding(model="embedding-2", api_key="YOUR API KEY")

response = embedding.get_general_text_embedding("who are you?")
print(response)

# Output: [0.1, 0.2, ...]

import asyncio

response = asyncio.run(embedding.aget_general_text_embedding("who are you?"))
print(response)
# Output: [0.1, 0.2, ...]
```

### ZhipuAI Documentation

https://bigmodel.cn/dev/howuse/introduction
llama-index-readers-maps 0.4.1
llama-index readers maps integration
Requires Python: <4.0,>=3.9
Keywords: geo, maps, open maps, open street maps, overpass api

# **_Osmmap Loader_**

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

The Osmmap Loader will fetch map data from the [Overpass](https://wiki.openstreetmap.org/wiki/Main_Page) api for a certain place or area. Version **Overpass API 0.7.60** is used by this loader.

The api will provide you with all the **nodes, relations, and ways** for the particular region when you request data for a region or location.

## **Functions of the loader**

- To start, it first filters out those nodes that are already tagged, leaving just those nodes that are within 2 kilometres of the target location. The following keys are removed during filtering:["nodes," "geometry," "members"] from each node. The response we received is based on the tags and values we provided, so be sure to do that. The actions are covered below.

## **Steps to find the suitable tag and values**

1. Visit [Taginfo](taginfo.openstreetmap.org/tags). In essence, this website has all conceivable tags and values.
2. Perform a search for the feature you're looking for, for instance, "hospital" will return three results: "hospital" as an amenity, "hospital" as a structure, and "hospital" as a healthcare facility.
3. We may infer from the outcome that tag=amenity and value=hospital.
4. Leave the values parameter to their default value if you do not need to filter.

## **Usage**

The use case is here.

Let's meet **Jayasree**, who is extracting map features from her neighbourhood using the OSM map loader.
She requires all the nodes, routes, and relations within a five-kilometer radius of her locale (Guduvanchery).

- She must use the following arguments in order to accomplish the aforementioned. Localarea = "Guduvanchery" (the location she wants to seek), local_area_buffer = 5000 (5 km).

### And the code snippet looks like

```python
from llama_index.readers.maps import OpenMap

loader = MapReader()
documents = loader.load_data(
    localarea="Guduvanchery",
    search_tag="",
    tag_only=True,
    local_area_buffer=5000,
    tag_values=[""],
)
```

### Now she wants only the list hospitals around the location

- so she search for hospital tag in the [Taginfo](https://taginfo.openstreetmap.org/tags) and she got

```python
from llama_index.readers.maps import OpenMap

loader = MapReader()
documents = loader.load_data(
    localarea="Guduvanchery",
    search_tag="amenity",
    tag_only=True,
    local_area_buffer=5000,
    tag_values=["hospital", "clinic"],
)
```

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

# Slack Tool

This tool fetches the text from a list of Slack channels. You will need to initialize the loader with your Slack API Token or have the `SLACK_BOT_TOKEN` environment variable set.

## Usage

```python
from llama_index.tools.slack import SlackToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

tool_spec = SlackToolSpec(slack_token="token")

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

print(
    await agent.run(
        "What is the most recent message in the announcements channel?"
    )
)
```

`load_data`: Loads messages from a list of channels
`send_message`: Sends a message to a channel
`fetch_channel`: Fetches the list of channels

This loader is designed to be used as a way to load data as a Tool in a Agent.
golem-vm-discovery 0.1.25
VM on Golem Discovery Service - Central hub for provider discovery and resource matching
Requires Python: <4.0,>=3.9
Keywords: golem, discovery, resource-matching, marketplace, decentralized

# Golem VM Discovery Server

The Discovery Server acts as the central hub for the Golem Network, enabling requestors to find providers with matching resources.

## Installation

```bash
pip install golem-vm-discovery
```

## Running the Server

The Discovery Server comes with sensible defaults and can be run immediately after installation:

```bash
golem-discovery
```

The server will start with the following default configuration:
- Listen on all interfaces (0.0.0.0) port 9001
- Store data in SQLite at ~/.golem/discovery/discovery.db
- Rate limit to 100 requests per minute per IP
- Clean up expired advertisements every minute
- Require provider advertisement refresh every 5 minutes

### Configuration

All settings have built-in defaults and can be optionally overridden using environment variables:

```bash
# Override only what you need:

# Change the port
GOLEM_DISCOVERY_PORT=8000

# Enable debug mode
GOLEM_DISCOVERY_DEBUG=true

# Use a different database location
GOLEM_DISCOVERY_DATABASE_DIR="/custom/path"
```

### Default Settings

| Setting | Default | Environment Variable | Description |
|---------|---------|---------------------|-------------|
| Host | 0.0.0.0 | GOLEM_DISCOVERY_HOST | Listen interface |
| Port | 9001 | GOLEM_DISCOVERY_PORT | Listen port |
| Debug | false | GOLEM_DISCOVERY_DEBUG | Enable debug mode |
| Database Dir | ~/.golem/discovery | GOLEM_DISCOVERY_DATABASE_DIR | Database directory |
| Database Name | discovery.db | GOLEM_DISCOVERY_DATABASE_NAME | Database filename |
| Rate Limit | 100 | GOLEM_DISCOVERY_RATE_LIMIT_PER_MINUTE | Requests per minute per IP |
| Ad Expiry | 5 | GOLEM_DISCOVERY_ADVERTISEMENT_EXPIRY_MINUTES | Minutes until ads expire |
| Cleanup Interval | 60 | GOLEM_DISCOVERY_CLEANUP_INTERVAL_SECONDS | Seconds between cleanups |

## API Endpoints

- `GET /health` - Health check endpoint
- `GET /api/v1/advertisements` - List available providers
- `POST /api/v1/advertisements` - Register a provider

## Environment Variables

All settings can be configured through environment variables:

| Variable | Description | Default |
|----------|-------------|---------|
| GOLEM_DISCOVERY_HOST | Server host | 0.0.0.0 |
| GOLEM_DISCOVERY_PORT | Server port | 9001 |
| GOLEM_DISCOVERY_DEBUG | Enable debug mode | false |
| GOLEM_DISCOVERY_DATABASE_DIR | Database directory | ~/.golem/discovery |
| GOLEM_DISCOVERY_DATABASE_NAME | Database filename | discovery.db |
| GOLEM_DISCOVERY_RATE_LIMIT_PER_MINUTE | Rate limit per IP | 100 |
| GOLEM_DISCOVERY_ADVERTISEMENT_EXPIRY_MINUTES | Advertisement TTL | 5 |
| GOLEM_DISCOVERY_CLEANUP_INTERVAL_SECONDS | Cleanup interval | 60 |

## Development

To run the server in development mode:

```bash
GOLEM_DISCOVERY_DEBUG=true golem-discovery
```

This will enable auto-reload on code changes and more detailed logging.
llama-index-embeddings-textembed 0.3.1
Integration of TextEmbed with llama-index for embeddings.
Requires Python: <4.0,>=3.9

# TextEmbed - Embedding Inference Server

Maintained by Keval Dekivadiya, TextEmbed is licensed under the [Apache-2.0 License](https://opensource.org/licenses/Apache-2.0).

TextEmbed is a high-throughput, low-latency REST API designed for serving vector embeddings. It supports a wide range of sentence-transformer models and frameworks, making it suitable for various applications in natural language processing.

## Features

- **High Throughput & Low Latency**: Designed to handle a large number of requests efficiently.
- **Flexible Model Support**: Works with various sentence-transformer models.
- **Scalable**: Easily integrates into larger systems and scales with demand.
- **Batch Processing**: Supports batch processing for better and faster inference.
- **OpenAI Compatible REST API Endpoint**: Provides an OpenAI compatible REST API endpoint.
- **Single Line Command Deployment**: Deploy multiple models via a single command for efficient deployment.
- **Support for Embedding Formats**: Supports binary, float16, and float32 embeddings formats for faster retrieval.

## Getting Started

### Prerequisites

Ensure you have Python 3.10 or higher installed. You will also need to install the required dependencies.

### Installation via PyPI

Install the required dependencies:

```bash
pip install -U textembed
```

### Start the TextEmbed Server

Start the TextEmbed server with your desired models:

```bash
python -m textembed.server --models sentence-transformers/all-MiniLM-L12-v2 --workers 4 --api-key TextEmbed
```

### Example Usage with llama-index

Here's a simple example to get you started with llama-index:

```python
from llama_index.embeddings.textembed import TextEmbedEmbedding

# Initialize the TextEmbedEmbedding class
embed = TextEmbedEmbedding(
    model_name="sentence-transformers/all-MiniLM-L12-v2",
    base_url="http://0.0.0.0:8000/v1",
    auth_token="TextEmbed",
)

# Get embeddings for a batch of texts
embeddings = embed.get_text_embedding_batch(
    [
        "It is raining cats and dogs here!",
        "India has a diverse cultural heritage.",
    ]
)

print(embeddings)
```

For more information, please read the [documentation](https://github.com/kevaldekivadiya2415/textembed/blob/main/docs/setup.md).
llama-index-embeddings-oracleai 0.3.1
llama-index embeddings oracleai integration
Requires Python: <4.0,>=3.9

# LlamaIndex Embeddings Integration: Oracleai

This API is to generate an embedding from a text.

`pip install llama-index-embeddings-oracleai`

# A sample example

```python
from typing import TYPE_CHECKING
from llama_index.core.embeddings import BaseEmbedding
from llama_index.embeddings.oracleai import OracleEmbeddings

if TYPE_CHECKING:
    import oracledb

""" get the Oracle connection """
conn = oracledb.connect(
    user="<user>",
    password="<password>",
    dsn="<dsn>",
)
print("Oracle connection is established...")

""" params """
embedder_params = {"provider": "<provider_name>", "model": "<model_name>"}
proxy = "<proxy>"

""" instance """
embedder = OracleEmbeddings(conn=conn, params=embedder_params, proxy=proxy)

embed = embedder._get_text_embedding("Hello World, Text!")
print(f"Embedding generated by OracleEmbeddings: {embed}")

embed = embedder._get_query_embedding("Hello World, Query!")
print(f"Embedding generated by OracleEmbeddings: {embed}")

conn.close()
print("Connection is closed.")
```
llama-index-embeddings-openai-like 0.2.2
llama-index embeddings openai integration
Requires Python: <4.0,>=3.9

# OpenAILike Embeddings

This integration allows you to use OpenAI-like embeddings APIs with LlamaIndex.

## Installation

```bash
pip install llama-index-embeddings-openai-like
```

## Usage

```python
from llama_index.embeddings.openai_like import OpenAILikeEmbedding

embedding = OpenAILikeEmbedding(
    model_name="my-model-name",
    api_key="fake",
    api_base="http://localhost:1234/v1",
    embed_batch_size=10,
)
```
llama-index-embeddings-netmind 0.2.1
llama-index embeddings netmind integration
Requires Python: <4.0,>=3.9

# LlamaIndex Embeddings Integration: Netmind

## Installation

To install the required package, run:

```shell
pip install llama-index-llms-netmind
```

## Setup

1. Set your Netmind API key as an environment variable. Visit https://www.netmind.ai/ and sign up to get an API key.

```shell
import os

os.environ["NETMIND_API_KEY"] = "you_api_key"
```

## Basic Usage

```python
from llama_index.embeddings.netmind import NetmindEmbedding

embed_model = NetmindEmbedding(model_name="BAAI/bge-m3", api_key="")
embeddings = embed_model.get_text_embedding("hello world")
print(len(embeddings))
```
llama-index-embeddings-nebius 0.4.1
llama-index embeddings Nebius AI Studio integration
Requires Python: <4.0,>=3.9

# LlamaIndex Embeddings Integration: [Nebius AI Studio](https://studio.nebius.ai/)

## Overview

Integrate with Nebius AI Studio API, which provides access to open-source state-of-the-art text embeddings models.

## Installation

```bash
pip install llama-index-embeddings-nebius
```

## Usage

### Initialization

#### With environmental variables.

```.env
NEBIUS_API_KEY=your_api_key

```

```python
from llama_index.embeddings.nebius import NebiusEmbedding

embed_model = NebiusEmbedding(model_name="BAAI/bge-en-icl")
```

#### Without environmental variables

```python
from llama_index.embeddings.nebius import NebiusEmbedding

embed_model = NebiusEmbedding(
    api_key="your_api_key", model_name="BAAI/bge-en-icl"
)
```

### Launching

#### Basic usage

```python
text = "Everyone loves justice at another person's expense"
embeddings = embed_model.get_text_embedding(text)
print(embeddings[:5])
```

#### Asynchronous usage

```python
text = "Everyone loves justice at another person's expense"
embeddings = await embed_model.aget_text_embedding(text)
print(embeddings[:5])
```

#### Batched usage

```python
texts = [
    "As the hours pass",
    "I will let you know",
    "That I need to ask",
    "Before I'm alone",
]

embeddings = embed_model.get_text_embedding_batch(texts)
print(*[x[:3] for x in embeddings], sep="\n")
```

#### Batched asynchronous usage

```python
texts = [
    "As the hours pass",
    "I will let you know",
    "That I need to ask",
    "Before I'm alone",
]

embeddings = await embed_model.aget_text_embedding_batch(texts)
print(*[x[:3] for x in embeddings], sep="\n")
```
llama-index-embeddings-huggingface-api 0.4.1
llama-index embeddings huggingface api integration
Requires Python: <4.0,>=3.9

# LlamaIndex Embeddings Integration: Huggingface API

Integration with Hugging Face's Inference API for embeddings.

For more information on Hugging Face's Inference API, visit [Hugging Face's Inference API documentation](https://huggingface.co/docs/api-inference/quicktour).

## Installation

```shell
pip install llama-index-embeddings-huggingface-api
```

## Usage

```python
from llama_index.embeddings.huggingface_api import (
    HuggingFaceInferenceAPIEmbedding,
)

my_embed = HuggingFaceInferenceAPIEmbedding(
    model_name="BAAI/bge-small-en-v1.5",
    token="<your-token>",  # Optional
)

embeddings = my_embed.get_text_embedding("Why sky is blue")
```