Metadata-Version: 2.4
Name: tigercitysdk
Version: 0.1.0
Summary: Python SDK for the TigerCity.ai API. List, fine-tune and train custom AI models, and generate or stream responses from the TigerCity.ai platform.
Author-email: TigerCity <support@tigercity.ai>
License-Expression: MIT
Project-URL: Homepage, https://tigercity.ai
Project-URL: Documentation, https://tigercity.ai/docs
Project-URL: Repository, https://github.com/tigercity/tigercitysdk
Project-URL: Issues, https://github.com/tigercity/tigercitysdk/issues
Keywords: tigercity,ai,api,sdk,client
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Dynamic: license-file

# TigerCity Python SDK

The official Python client for the [TigerCity.ai](https://tigercity.ai) API.

A clean, object-oriented interface to list, create, fine-tune and train custom
AI models, and to generate or stream responses from the TigerCity.ai platform.

## Installation

```bash
pip install tigercitysdk
```

Requires Python 3.7 or later.

## Quickstart

```python
from tigercitysdk import TigerCityClient, Message, TrainingMethod, StreamingChunkType

# The client reads the TIGER_API_KEY environment variable,
# or you can pass api_key="..." explicitly.
client = TigerCityClient()

# List available models
models = client.list_models()
for model in models:
    print(f"{model.name} ({model.id})")

# Generate a response (non-streaming)
messages = [
    Message(role="system", content="You are a helpful assistant."),
    Message(role="user", content="Why is the sky blue?"),
]
response = client.generate_response(
    model="Llama-3.1-8b",
    messages=messages,
    temperature=0.7,
)
print(response.message.content)

# Generate a response (streaming)
def handle_chunk(chunk):
    if chunk.type == StreamingChunkType.DELTA:
        print(chunk.delta, end="", flush=True)

client.generate_response_stream(
    model="Llama-3.1-8b",
    messages=messages,
    callback=handle_chunk,
)

# Train a model
result = client.train(
    model="MyCustomModel",
    messages=messages,
    method=TrainingMethod.GCE,
    learning_steps=2,
    learning_rate=1e-5,
)
```

See the [documentation](https://tigercity.ai/docs) for the full API reference,
including model creation, deletion, and training.

## Configuration

The client is configured through the following environment variables:

- `TIGER_API_KEY` - your TigerCity.ai API key (or pass `api_key` to the client).

## License

Released under the [MIT License](LICENSE).
