A FastAPI-based web server for working with LLMs, embedding models, and PostgresSQL.
Project description
TextWeaver
TextWeaver is a FastAPI-based web server designed for working with Large Language Models (LLMs), specifically with Embeddings-style models. It simplifies the process of handling complex natural language processing tasks and offers a robust and scalable solution for both developers and researchers to store and query against embeddings in Pinecone.
Features
- FastAPI Integration: Leverage the power of FastAPI for creating modern and efficient web APIs.
- LLM and Embedding Support: Easily work with LLMs and various embedding models for rich textual analysis.
- Scalable Architecture: Designed to grow with your needs, TextWeaver can be deployed across various environments.
- User-Friendly Configuration: Get started quickly with intuitive configuration options.
Installation
Please note that TextWeaver requires the use of Amazon Cognito for authentication. You can find more information on how to set up Cognito here. Once you have Cognito set up, you can pass the required id tokens to the server using the Authorization
header.
Please note that TextWeaver requires the use of SNS for sending errors and server events. You can find more information on how to set up SNS here. Once you have SNS set up, you will need to create a topic and pass the required topic name to the server using the .env
file.
Please note that TextWeaver requires the use of Pinecone for storing and querying against embeddings. You can find more information on how to set up Pinecone here. Once you have Pinecone set up, you will need to create two indexes: one for the embeddings and one for the user embeddings. You can then pass the required API key and index names to the server using the .env
file.
To install TextWeaver, you need to have a .env file in the root directory of your project. This file should contain the following variables:
HOST_IP="" # The IP to bind the server to - 0.0.0.0 for all interfaces
PORT="" # The port to bind the server to - 80 for HTTP and 443 for HTTPS
AWS_ACCESS_KEY_ID="" # The access key ID for the AWS user (recommended to use an IAM role where possible, or a user with limited permissions)
AWS_SECRET_ACCESS_KEY="" # The secret access key for the AWS user
AWS_DEFAULT_REGION="" # The default region for the AWS user
AWS_COGNITO_REGION="" # The region for the AWS Cognito user pool
AWS_USER_POOL_ID="" # The ID for the AWS Cognito user pool
AWS_USER_POOL_CLIENT_ID="" # The client ID for the AWS Cognito user pool
SNS_TOPIC_NAME="" # The name of the SNS topic to errors and server events to
PINECONE_API_KEY="" # The API key for the Pinecone environment
PINECONE_ENVIRONMENT="" # The name of the Pinecone environment
PINECONE_INDEX_NAME="" # The name of the Pinecone index
PINECONE_USER_INDEX_NAME="" # The name of the Pinecone user index
MODEL_PATH="" # Where the model path is the appropriate path for the sentence_transformer model hosted on HuggingFace
Install TextWeaver directly from PyPI using the following command:
pip install textweaver
Usage
Once installed, you can start the TextWeaver server using the following command:
textweaver
For further customization and detailed documentation, please refer to the project's repository.
Contribution
We welcome contributions from the community! Please check the contributing guidelines in the repository for more information on how you can get involved.
License
TextWeaver is released under the MIT License. See the LICENSE file in the repository for more details.
Contact
For any inquiries, support, or collaboration, please contact the author at wesladd@traingrc.com or open an issue on the project's GitHub page.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file textweaver-0.2.97.tar.gz
.
File metadata
- Download URL: textweaver-0.2.97.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63c5533471450e587a1040061adfe24baeea1ddfc3f22af5c05c73c2132a87f0 |
|
MD5 | dbed98c312fa4a13921f7eb81348d9c8 |
|
BLAKE2b-256 | df9d44073a75d841c8497c5ff83abd9dd8dfa8a150328f69675d96cc5f4aacfc |
File details
Details for the file textweaver-0.2.97-py3-none-any.whl
.
File metadata
- Download URL: textweaver-0.2.97-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0f1a42ed2293052b0ef14b65b56207f923a1e43c4e81b44823db6de163d319f |
|
MD5 | be66d56cbb844fbf6acbfad760367c2d |
|
BLAKE2b-256 | 2643019f098ebdb6c214e1967ade90f11aa1cadf92e7cd9d4ad293b56ecd4b65 |