autobyteus-llm-client


Nameautobyteus-llm-client JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/AutoByteus/autobyteus_llm_client.git
SummaryAsync Python client for Autobyteus LLM API
upload_time2025-07-14 10:37:21
maintainerNone
docs_urlNone
authorRyan Zheng
requires_python>=3.8
licenseNone
keywords llm client async
VCS
bugtrack_url
requirements httpx cryptography
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Autobyteus LLM Client

Async Python client for Autobyteus LLM API with HTTPS support.

## Installation

```bash
pip install autobyteus_llm_client
```

## Certificate Setup

1. Create certificates directory:
```bash
mkdir -p certificates
```

2. Copy the server's certificate:
```bash
cp path/to/server/certificates/cert.pem certificates/
```

3. Get certificate fingerprint (optional but recommended):
```bash
openssl x509 -in certificates/cert.pem -fingerprint -sha256 -noout
```

## Configuration

Set environment variables:
```bash
# 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

```python
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
```bash
pip install -e ".[test]"
```

### Running Tests
```bash
pytest
```

## Building and Publishing

### Build Package
```bash
python -m build
```

### Publish to Test PyPI
```bash
python -m twine upload --repository testpypi dist/*
```

### Publish to Production PyPI
```bash
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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/AutoByteus/autobyteus_llm_client.git",
    "name": "autobyteus-llm-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "llm client async",
    "author": "Ryan Zheng",
    "author_email": "ryan.zheng.work@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4d/6b/952e60e2517832db98c2f51a66aebfb2204877f6d8d487e5fdb486e2937a/autobyteus_llm_client-1.1.1.tar.gz",
    "platform": null,
    "description": "# Autobyteus LLM Client\n\nAsync Python client for Autobyteus LLM API with HTTPS support.\n\n## Installation\n\n```bash\npip install autobyteus_llm_client\n```\n\n## Certificate Setup\n\n1. Create certificates directory:\n```bash\nmkdir -p certificates\n```\n\n2. Copy the server's certificate:\n```bash\ncp path/to/server/certificates/cert.pem certificates/\n```\n\n3. Get certificate fingerprint (optional but recommended):\n```bash\nopenssl x509 -in certificates/cert.pem -fingerprint -sha256 -noout\n```\n\n## Configuration\n\nSet environment variables:\n```bash\n# Required\nexport AUTOBYTEUS_API_KEY='your-api-key'\n\n# Optional (defaults shown)\nexport AUTOBYTEUS_LLM_SERVER_URL='https://api.autobyteus.com:8443'\nexport AUTOBYTEUS_CERT_FINGERPRINT='your-certificate-fingerprint'  # Optional but recommended\n```\n\n## Usage\n\n```python\nfrom autobyteus_llm_client import AutobyteusClient\n\nasync def main():\n    # Initialize client (automatically uses certificate from certificates/cert.pem)\n    client = AutobyteusClient()\n    \n    try:\n        # Get available models\n        models = await client.get_available_models()\n        print(f\"Available models: {models}\")\n        \n        # Send a message\n        response = await client.send_message(\n            conversation_id=\"conv123\",\n            model_name=\"gpt-4\",\n            user_message=\"Hello!\"\n        )\n        print(f\"Response: {response}\")\n        \n    finally:\n        await client.close()\n```\n\n## Security Features\n\n1. Certificate Verification\n   - Automatic certificate validation\n   - Certificate expiration checking\n   - Optional fingerprint verification\n   - Path validation and security checks\n\n2. SSL/TLS Security\n   - HTTPS communication\n   - Certificate-based authentication\n   - Secure default configuration\n\n## Development\n\n### Requirements\n- Python 3.8 or higher\n- httpx\n- cryptography\n\n### Installing Development Dependencies\n```bash\npip install -e \".[test]\"\n```\n\n### Running Tests\n```bash\npytest\n```\n\n## Building and Publishing\n\n### Build Package\n```bash\npython -m build\n```\n\n### Publish to Test PyPI\n```bash\npython -m twine upload --repository testpypi dist/*\n```\n\n### Publish to Production PyPI\n```bash\npython -m twine upload dist/*\n```\n\n## Troubleshooting\n\n1. Certificate Issues\n   - Verify certificate location (should be in `certificates/cert.pem`)\n   - Check certificate expiration\n   - Verify fingerprint if enabled\n\n2. Connection Issues\n   - Verify server URL and port\n   - Check certificate validity\n   - Ensure API key is set correctly\n\n## License\n\nThis project is licensed under the MIT License.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Async Python client for Autobyteus LLM API",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://github.com/AutoByteus/autobyteus_llm_client.git"
    },
    "split_keywords": [
        "llm",
        "client",
        "async"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "de5c3d4d64b851fc52cc49fdc50f64986b266b1863d88aebbed67312000d0b63",
                "md5": "298075218ab729d20e61d9f2bb58260c",
                "sha256": "aea144af385bae4d224bfe8a43cc2ed4922be7b3a773092f17b7fda833894a66"
            },
            "downloads": -1,
            "filename": "autobyteus_llm_client-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "298075218ab729d20e61d9f2bb58260c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 11535,
            "upload_time": "2025-07-14T10:37:20",
            "upload_time_iso_8601": "2025-07-14T10:37:20.253676Z",
            "url": "https://files.pythonhosted.org/packages/de/5c/3d4d64b851fc52cc49fdc50f64986b266b1863d88aebbed67312000d0b63/autobyteus_llm_client-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4d6b952e60e2517832db98c2f51a66aebfb2204877f6d8d487e5fdb486e2937a",
                "md5": "72ad63eb2b6736f2c53ba0bf47fc3ed0",
                "sha256": "30ebc264b867cf746ef9337125c0d0043f2f60a68aec4ae30525e34772396243"
            },
            "downloads": -1,
            "filename": "autobyteus_llm_client-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "72ad63eb2b6736f2c53ba0bf47fc3ed0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 10599,
            "upload_time": "2025-07-14T10:37:21",
            "upload_time_iso_8601": "2025-07-14T10:37:21.542937Z",
            "url": "https://files.pythonhosted.org/packages/4d/6b/952e60e2517832db98c2f51a66aebfb2204877f6d8d487e5fdb486e2937a/autobyteus_llm_client-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-14 10:37:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "AutoByteus",
    "github_project": "autobyteus_llm_client",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "httpx",
            "specs": []
        },
        {
            "name": "cryptography",
            "specs": []
        }
    ],
    "lcname": "autobyteus-llm-client"
}
        
Elapsed time: 1.21694s