Skip to main content

Async Python client for Autobyteus LLM API

Project description

Autobyteus LLM Client

Async Python client for Autobyteus LLM API with HTTPS support.

Installation

pip install autobyteus_llm_client

Certificate Setup

  1. Create certificates directory:
mkdir -p certificates
  1. Copy the server's certificate:
cp path/to/server/certificates/cert.pem certificates/
  1. Get certificate fingerprint (optional but recommended):
openssl x509 -in certificates/cert.pem -fingerprint -sha256 -noout

Configuration

Set environment variables:

# Required
export AUTOBYTEUS_API_KEY='your-api-key'

# Optional (defaults shown)
export AUTOBYTEUS_LLM_SERVER_URL='https://api.autobyteus.com:8443'
export AUTOBYTEUS_CERT_FINGERPRINT='your-certificate-fingerprint'  # Optional but recommended

Usage

from autobyteus_llm_client import AutobyteusClient

async def main():
    # Initialize client (automatically uses certificate from certificates/cert.pem)
    client = AutobyteusClient()
    
    try:
        # Get available models
        models = await client.get_available_models()
        print(f"Available models: {models}")
        
        # Send a message
        response = await client.send_message(
            conversation_id="conv123",
            model_name="gpt-4",
            user_message="Hello!"
        )
        print(f"Response: {response}")
        
    finally:
        await client.close()

Security Features

  1. Certificate Verification

    • Automatic certificate validation
    • Certificate expiration checking
    • Optional fingerprint verification
    • Path validation and security checks
  2. SSL/TLS Security

    • HTTPS communication
    • Certificate-based authentication
    • Secure default configuration

Development

Requirements

  • Python 3.8 or higher
  • httpx
  • cryptography

Installing Development Dependencies

pip install -e ".[test]"

Running Tests

pytest

Building and Publishing

Build Package

python -m build

Publish to Test PyPI

python -m twine upload --repository testpypi dist/*

Publish to Production PyPI

python -m twine upload dist/*

Troubleshooting

  1. Certificate Issues

    • Verify certificate location (should be in certificates/cert.pem)
    • Check certificate expiration
    • Verify fingerprint if enabled
  2. Connection Issues

    • Verify server URL and port
    • Check certificate validity
    • Ensure API key is set correctly

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autobyteus_llm_client-1.0.9.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autobyteus_llm_client-1.0.9-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file autobyteus_llm_client-1.0.9.tar.gz.

File metadata

  • Download URL: autobyteus_llm_client-1.0.9.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for autobyteus_llm_client-1.0.9.tar.gz
Algorithm Hash digest
SHA256 e56ed043d45e88655e4493d26d0d1c50d47de2e50eabe3c5a8e46f53b9322dfe
MD5 cbf5c7d52272bc641d8b42f320f4a0b8
BLAKE2b-256 1566c53c9f717fb6e5528f6f1e1b2565cfa7fa37bb03ffd95db1229a62eb3b15

See more details on using hashes here.

File details

Details for the file autobyteus_llm_client-1.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for autobyteus_llm_client-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 116a590d8631e6494d03c820558018dcb88fc56f767102b7c8e6088bf5d00b0a
MD5 1b328ba46854a4251d25c5581272980c
BLAKE2b-256 c952f5b87b1fcc1bcc034a0364da715fd65b3375a2285976491be9247124f07f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page