Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

KeyVault

Introduction

Simple, fast, convenient! KeyVault is a lightweight solution for centralizing the management of cloud service keys, particularly in development environments. It provides a centralized point for storing and retrieving API keys and secrets, streamlining the development process and enhancing security practices.

Key features and benefits include:

  • Centralized storage of API keys and secrets
  • Easy integration with development workflows
  • Simplified key management across multiple projects
  • Improved security through centralized access control
  • Configurable storage location for secrets
  • Production-ready with Waitress WSGI server

Features

  • Secure storage of key-value pairs
  • RESTful API for key retrieval and listing
  • Python client for easy integration
  • Configurable secret storage location
  • Logging and improved error handling
  • Waitress WSGI server for production deployment

Prerequisites

  • Python 3.7+

Installation

You can install KeyVault using pip:

pip install keyvault-llm

Or directly from the GitHub repository:

pip install git+https://github.com/ltoscano/keyvault.git

Quickstart

  1. Create a configuration file:

    {
      "OPENAI_API_KEY": "your-api-key-here",
      "OTHER_KEY": "another-key-value"
    }
    

    Save this as config.json in a secure location.

  2. Start the KeyVault server:

    python -m keyvault_llm.server --config /path/to/config.json
    

    By default, the server will run on http://localhost:38680. You can change the host and port using the --host and --port options.

  3. Use the client to interact with the server:

    from keyvault_llm.client import KeyVaultClient
    import logging
    
    logging.basicConfig(level=logging.INFO)
    
    client = KeyVaultClient("http://localhost:38680")
    
    try:
        # Get a specific key
        api_key = client.get_key('OPENAI_API_KEY')
        print("API Key:", api_key)
    
        # List all keys
        keys = client.list_keys()
        print("Available keys:", keys)
    except Exception as e:
        print(f"An error occurred: {str(e)}")
    

Configuration

KeyVault can be configured using command-line arguments when starting the server:

  • --config: Path to the config.json file (default: ~/.keyvault/config.json)
  • --host: Host to bind the server to (default: 0.0.0.0)
  • --port: Port to run the server on (default: 38680)

Example:

python -m keyvault_llm.server --config /path/to/config.json --host 127.0.0.1 --port 8080

Security Considerations

KeyVault is designed for use in development environments. While it can be used in production with proper security measures, it's essential to consider the following:

  1. Access Control: Ensure that the KeyVault server is only accessible within your trusted network.
  2. Secure Configuration: Store your config.json file in a secure location with appropriate file permissions.
  3. HTTPS: For production use, configure KeyVault behind a reverse proxy with HTTPS enabled.
  4. Regular Updates: Keep your KeyVault installation up to date with the latest security patches.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for keyvault-llm 0.1.4.dev0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for keyvault-llm 0.1.4.dev0
File Size Uploaded
keyvault_llm-0.1.4.dev0.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for keyvault-llm 0.1.4.dev0
File Interpreter ABI Platform
keyvault_llm-0.1.4.dev0-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / keyvault_llm-0.1.4.dev0.tar.gz

Download URL keyvault_llm-0.1.4.dev0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
01f5442acbaa61f8281fdd70a24c024b086b753ff5cc87d2a90b38486f176506
BLAKE2b-256 checksum
How to use checksums
ef16a84ac369a1e0e1472685154e70937b56d7093f28dd3bb62979e49aaa4ab0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / keyvault_llm-0.1.4.dev0-py3-none-any.whl

Download URL keyvault_llm-0.1.4.dev0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2aa797379f57d345476a8f51e3380fee5e5a67c8b8c4b1cac7401f52480fb786
BLAKE2b-256 checksum
How to use checksums
cab92cd10f3e075d129f32018368b3ad82c2b9318aa1f7bd5d33ffd1ca07069d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.4.dev0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page