loam-ai


Nameloam-ai JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryCLI tool for AWS Bedrock model invocation
upload_time2025-01-17 04:29:12
maintainerNone
docs_urlNone
authorBrendan Quinn
requires_python>=3.10
licenseNone
keywords ai aws bedrock cli machine-learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # loam-ai

A command-line interface (CLI) tool for interacting with AWS Bedrock foundation models and inference profiles. LoamAI provides a streamlined way to invoke AI models, generate embeddings, and manage conversations through AWS Bedrock.

## Features

- List available foundation models and inference profiles
- Generate text and image embeddings
- Stream model responses for real-time output
- Support for conversation-based model interactions
- Manage multiple AWS profiles and regions
- Rich terminal output formatting

## Installation

Requires Python 3.10 or higher.

```bash
pip install loam-ai
```

## Configuration

### AWS SSO Login

If you're using AWS SSO, first configure your AWS profile and log in:

```bash
export AWS_PROFILE=your-sso-profile
aws sso login
```

After successful login, you can run loam-ai commands using your SSO credentials.

## Usage

### List Available Models

```bash
loam list-models
```

Filter by provider or output type:

```bash
loam list-models --provider anthropic
loam list-models --output TEXT
```

### Check Session Information

```bash
loam session
```

### Generate Embeddings

Generate text embeddings:

```bash
loam generate-embeddings \
    --model-id amazon.titan-embed-text-v2:0 \
    --input-file texts.txt
```

Generate image embeddings:

```bash
loam generate-embeddings \
    --model-id amazon.titan-embed-image-v1 \
    --image image.jpg \
    --texts "Image description"
```

### Invoke Models

Simple text generation:

```bash
loam invoke \
    -m amazon.nova-lite-v1:0 \
    -p "What are the benefits of renewable energy?"
```

### Conversation Mode

Use conversation mode for chat-based interactions:

```bash
loam converse \
    --model-id "anthropic.claude-3-sonnet-20240229-v1:0" \
    --messages-file conversation.json
```

Example messages file format:

```json
[
  {
    "role": "user",
    "content": [{ "text": "What is the capital of France?" }]
  }
]
```

### List Inference Profiles

```bash
loam list-inference-profiles
```

## Command Options

### Global Options

- `--profile`: AWS profile name
- `--region`: AWS region
- `--debug`: Enable debug output

### Model Invocation Options

- `--temperature`: Control response randomness (0-1)
- `--max-tokens`: Maximum response length
- `--top-p`: Control response diversity (0-1)

## Error Handling

LoamAI provides clear error messages with rich terminal formatting. Common issues include:

- Invalid AWS credentials
- Unsupported model configurations
- Rate limiting
- Input validation errors

## Development

Built with:

- [Click](https://click.palletsprojects.com/) for CLI interface
- [Rich](https://rich.readthedocs.io/) for terminal formatting
- [boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html) for AWS SDK

## License

MIT License - See LICENSE file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "loam-ai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "ai, aws, bedrock, cli, machine-learning",
    "author": "Brendan Quinn",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/be/24/76c311de87909204d11915f79b73b67fa767f5f92a23ae7c859877740320/loam_ai-0.1.0.tar.gz",
    "platform": null,
    "description": "# loam-ai\n\nA command-line interface (CLI) tool for interacting with AWS Bedrock foundation models and inference profiles. LoamAI provides a streamlined way to invoke AI models, generate embeddings, and manage conversations through AWS Bedrock.\n\n## Features\n\n- List available foundation models and inference profiles\n- Generate text and image embeddings\n- Stream model responses for real-time output\n- Support for conversation-based model interactions\n- Manage multiple AWS profiles and regions\n- Rich terminal output formatting\n\n## Installation\n\nRequires Python 3.10 or higher.\n\n```bash\npip install loam-ai\n```\n\n## Configuration\n\n### AWS SSO Login\n\nIf you're using AWS SSO, first configure your AWS profile and log in:\n\n```bash\nexport AWS_PROFILE=your-sso-profile\naws sso login\n```\n\nAfter successful login, you can run loam-ai commands using your SSO credentials.\n\n## Usage\n\n### List Available Models\n\n```bash\nloam list-models\n```\n\nFilter by provider or output type:\n\n```bash\nloam list-models --provider anthropic\nloam list-models --output TEXT\n```\n\n### Check Session Information\n\n```bash\nloam session\n```\n\n### Generate Embeddings\n\nGenerate text embeddings:\n\n```bash\nloam generate-embeddings \\\n    --model-id amazon.titan-embed-text-v2:0 \\\n    --input-file texts.txt\n```\n\nGenerate image embeddings:\n\n```bash\nloam generate-embeddings \\\n    --model-id amazon.titan-embed-image-v1 \\\n    --image image.jpg \\\n    --texts \"Image description\"\n```\n\n### Invoke Models\n\nSimple text generation:\n\n```bash\nloam invoke \\\n    -m amazon.nova-lite-v1:0 \\\n    -p \"What are the benefits of renewable energy?\"\n```\n\n### Conversation Mode\n\nUse conversation mode for chat-based interactions:\n\n```bash\nloam converse \\\n    --model-id \"anthropic.claude-3-sonnet-20240229-v1:0\" \\\n    --messages-file conversation.json\n```\n\nExample messages file format:\n\n```json\n[\n  {\n    \"role\": \"user\",\n    \"content\": [{ \"text\": \"What is the capital of France?\" }]\n  }\n]\n```\n\n### List Inference Profiles\n\n```bash\nloam list-inference-profiles\n```\n\n## Command Options\n\n### Global Options\n\n- `--profile`: AWS profile name\n- `--region`: AWS region\n- `--debug`: Enable debug output\n\n### Model Invocation Options\n\n- `--temperature`: Control response randomness (0-1)\n- `--max-tokens`: Maximum response length\n- `--top-p`: Control response diversity (0-1)\n\n## Error Handling\n\nLoamAI provides clear error messages with rich terminal formatting. Common issues include:\n\n- Invalid AWS credentials\n- Unsupported model configurations\n- Rate limiting\n- Input validation errors\n\n## Development\n\nBuilt with:\n\n- [Click](https://click.palletsprojects.com/) for CLI interface\n- [Rich](https://rich.readthedocs.io/) for terminal formatting\n- [boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html) for AWS SDK\n\n## License\n\nMIT License - See LICENSE file for details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "CLI tool for AWS Bedrock model invocation",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/nulib-labs/loam-ai",
        "Issues": "https://github.com/nulib-labs/loam-ai/issues",
        "Repository": "https://github.com/nulib-labs/loam-ai.git"
    },
    "split_keywords": [
        "ai",
        " aws",
        " bedrock",
        " cli",
        " machine-learning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dc39f289ed07714b6182f07d3bc311c542d28544282e6a63e7cb6b1267d574e7",
                "md5": "8fdeb6f9bd33c7c0f48097d36970a014",
                "sha256": "44277ff93d32e75554a33c97a0fbfabb8b5d0d938f3daf2f320c5db72e70f7e5"
            },
            "downloads": -1,
            "filename": "loam_ai-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8fdeb6f9bd33c7c0f48097d36970a014",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 12249,
            "upload_time": "2025-01-17T04:29:09",
            "upload_time_iso_8601": "2025-01-17T04:29:09.597392Z",
            "url": "https://files.pythonhosted.org/packages/dc/39/f289ed07714b6182f07d3bc311c542d28544282e6a63e7cb6b1267d574e7/loam_ai-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "be2476c311de87909204d11915f79b73b67fa767f5f92a23ae7c859877740320",
                "md5": "16040cf1df70568d222c4cb2142f4464",
                "sha256": "fac8c5cf94cb303ba706e6d476442c426bc9f84916566281eed1b431b6bdeeff"
            },
            "downloads": -1,
            "filename": "loam_ai-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "16040cf1df70568d222c4cb2142f4464",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 30778,
            "upload_time": "2025-01-17T04:29:12",
            "upload_time_iso_8601": "2025-01-17T04:29:12.060168Z",
            "url": "https://files.pythonhosted.org/packages/be/24/76c311de87909204d11915f79b73b67fa767f5f92a23ae7c859877740320/loam_ai-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-17 04:29:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nulib-labs",
    "github_project": "loam-ai",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "loam-ai"
}
        
Elapsed time: 0.78388s