--- id: llama-api-client version: "0.6.0" license: MIT license_treatment: permissive maintenance: active --- # llama-api-client — The official Python library for the llama-api-client API License: permissive · Maintenance: active · Downloads: 136.9K/mo ## What it is and what it does This is an official Python client library for the Llama API, generated using Stainless. It wraps the Llama API REST endpoints with type-safe request and response objects, built on httpx for HTTP transport. The library supports both synchronous and asynchronous usage patterns, with the async client optionally using aiohttp for improved concurrency. It includes full type hints for all request parameters and response fields, enabling IDE autocomplete and static type checking. The client handles common API patterns: chat completions (including streaming via Server-Side Events), file uploads with multipart support, and structured error handling with automatic retries for transient failures. Responses are Pydantic models with helper methods for JSON serialization and dictionary conversion. The library targets Python 3.9 and later, supporting current and recent Python versions. Use it for: - Build a chatbot or conversational AI application using Llama models with typed, autocompleted API calls. - Stream Llama model responses token-by-token for real-time user feedback in web or CLI applications. - Integrate Llama API calls into async Python services or concurrent batch-processing pipelines. - Upload fine-tuning datasets to Llama API using the built-in file upload and multipart handling. - Handle API errors gracefully with automatic retries and specific exception types for different failure modes. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a typed Python client for the Llama API with support for synchronous and asynchronous requests, streaming responses, and automatic error handling. Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and installs with low friction. It provides a well-typed, officially-backed client for Llama API access with both sync and async support. Install it if you need to integrate Llama models into a Python application. ## Install pip install llama-api-client uv add llama-api-client poetry add llama-api-client ## Installing llama-api-client Before you install: Low friction install with six common runtime dependencies (anyio, distro, httpx, pydantic, sniffio, typing-extensions). The package is actively maintained with recent commits and has been in active development since April 2025. License in practice: MIT license is permissive, allowing use in commercial and private projects with minimal restrictions—only requiring attribution and inclusion of the license text. Quickstart: pip install llama-api-client import os from llama_api_client import LlamaAPIClient client = LlamaAPIClient( api_key=os.environ.get("LLAMA_API_KEY"), ) response = client.chat.completions.create( messages=[{"content": "string", "role": "user"}], model="model", ) print(response.completion_message) Requires a valid LLAMA_API_KEY environment variable or explicit api_key parameter to authenticate with the Llama API. Verify before relying: - Whether the package is officially maintained by Meta or a third-party wrapper around the Llama API. - Rate limits, quotas, or cost implications of using the Llama API through this client. - Whether all Llama API endpoints are fully covered or if some are missing. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 136.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags llama api python client, meta llama api library, llama chat completions, async llama api, llama streaming responses, typed llama client, llama api error handling, llama-models, api-client, async-support [View on SkillFed](https://skillfed.io/packages/llama-api-client) · [View on PyPI](https://pypi.org/project/llama-api-client/)