Metadata-Version: 2.4
Name: litellm-ainative
Version: 0.1.0
Summary: AINative provider for litellm — free Llama, Qwen, DeepSeek & Kimi models via one call.
Author-email: AINative Studio <dev@ainative.studio>
License-Expression: MIT
Project-URL: Homepage, https://github.com/AINative-Studio/litellm-ainative
Project-URL: Documentation, https://docs.ainative.studio
Project-URL: Repository, https://github.com/AINative-Studio/litellm-ainative
Project-URL: Issues, https://github.com/AINative-Studio/litellm-ainative/issues
Keywords: litellm,litellm-provider,litellm-plugin,openai-compatible,free-llm,llama,llama-3,qwen,qwen-coder,deepseek,deepseek-coder,kimi,kimi-k2,ainative,zerodb,auto-provisioning,chat-completion,tool-calling,embeddings,claude,cursor,free-api,inference,ai-gateway,model-router,openai-proxy
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
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
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: litellm>=1.0
Requires-Dist: requests>=2.28
Dynamic: license-file

# litellm-ainative

AINative provider for [litellm](https://github.com/BerriAI/litellm) — free Llama, Qwen, DeepSeek & Kimi models through litellm's unified interface.

## Install

```bash
pip install litellm-ainative
```

## Quick Start

```python
import litellm
from litellm_ainative import configure

# Auto-provisions a free API key (no signup required)
configure()

# Use any AINative model through litellm
response = litellm.completion(
    model="ainative/meta-llama/Llama-3.3-70B-Instruct",
    messages=[{"role": "user", "content": "Explain quantum computing in one paragraph."}],
)
print(response.choices[0].message.content)
```

## Available Models

All models are **free** with tool-calling support:

| Model | litellm Name |
|-------|-------------|
| Llama 3.3 70B | `ainative/meta-llama/Llama-3.3-70B-Instruct` |
| Llama 4 Scout 17B | `ainative/meta-llama/Llama-4-Scout-17B-16E-Instruct` |
| Qwen3 Coder Flash | `ainative/qwen3-coder-flash` |
| DeepSeek 4 Flash | `ainative/deepseek-4-flash` |
| Kimi K2 | `ainative/kimi-k2` |

## Configuration

### With an existing API key

```python
from litellm_ainative import configure

configure(api_key="your_ainative_api_key")
```

### With environment variable

```bash
export AINATIVE_API_KEY=your_key
```

```python
from litellm_ainative import configure
configure()
```

### Auto-provisioning (default)

If no key is found, `configure()` auto-provisions a temporary API key via
AINative's instant-db endpoint. The key is valid for 72 hours. Claim it for
permanent access at https://ainative.studio/claim.

```python
from litellm_ainative import configure
configure()  # auto-provisions if no key found
```

### Disable auto-provisioning

```python
from litellm_ainative import configure
configure(auto_provision=False)  # raises RuntimeError if no key
```

## Convenience Wrapper

For simpler usage without managing litellm directly:

```python
from litellm_ainative import configure
from litellm_ainative.provider import completion

configure()

response = completion(
    model="ainative/kimi-k2",
    messages=[{"role": "user", "content": "Write a haiku about code."}],
    temperature=0.7,
)
```

## Tool Calling

All models support OpenAI-compatible tool calling:

```python
import litellm
from litellm_ainative import configure

configure()

tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get weather for a location",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {"type": "string"}
                },
                "required": ["location"],
            },
        },
    }
]

response = litellm.completion(
    model="ainative/qwen3-coder-flash",
    messages=[{"role": "user", "content": "What's the weather in Tokyo?"}],
    tools=tools,
)
```

## How It Works

`litellm-ainative` registers AINative models with litellm's model registry
using the `openai` provider backend (since AINative exposes an
OpenAI-compatible `/chat/completions` endpoint). When you call
`litellm.completion(model="ainative/...")`, litellm routes the request
through the OpenAI provider to AINative's API gateway.

## Links

- [AINative Studio](https://ainative.studio)
- [Documentation](https://docs.ainative.studio)
- [litellm docs](https://docs.litellm.ai)
