Skip to main content

litellm-ainative

AINative provider for litellm — free Llama, Qwen, DeepSeek & Kimi models through litellm's unified interface.

Install

pip install litellm-ainative

Quick Start

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

from litellm_ainative import configure

configure(api_key="your_ainative_api_key")

With environment variable

export AINATIVE_API_KEY=your_key
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.

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

Disable auto-provisioning

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

Convenience Wrapper

For simpler usage without managing litellm directly:

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:

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

Metadata

Release files for litellm-ainative 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for litellm-ainative 0.1.0
File Size Uploaded
litellm_ainative-0.1.0.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for litellm-ainative 0.1.0
File Interpreter ABI Platform
litellm_ainative-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.5 kB

Release files / litellm_ainative-0.1.0.tar.gz

Download URL litellm_ainative-0.1.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1da886956e6b8605b1cc4e76607021af1f351bdf7f7ad20248f00c6414f6703b
BLAKE2b-256 checksum
How to use checksums
3ec758b49d1cc9db5aca7a757c6fb9c0c84df51896472253e7a53372acf0c4e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / litellm_ainative-0.1.0-py3-none-any.whl

Download URL litellm_ainative-0.1.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60081e780b0fccc8b7243a92aff6f5d8d0166130a6b6575e0cff40948d4797dc
BLAKE2b-256 checksum
How to use checksums
121f4613bae7775fbc21b34fde4f477b5a692562deee7f2d0cb71a404ef1cfc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page