Observed since 21 Oct, 11:26 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
ainative-openai
Drop-in replacement for the OpenAI Python SDK — routes to AINative's free Llama, Qwen, DeepSeek & Kimi API.
Drop-in replacement for the OpenAI Python SDK that routes to AINative's free API — Llama, Qwen, DeepSeek, and Kimi models with zero configuration.
pip install ainative-openai
Replace from openai import OpenAI with from ainative_openai import OpenAI. That's it.
from ainative_openai import OpenAI
client = OpenAI() # auto-provisions a free API key
response = client.chat.completions.create(
model="meta-llama/Llama-3.3-70B-Instruct",
messages=[{"role": "user", "content": "Explain quantum computing in 3 sentences."}],
)
print(response.choices[0].message.content)
First run auto-provisions a free API key (72h expiry) and saves it to ~/.ainative/config.json. Follow the printed claim URL to get a permanent key.
import asyncio
from ainative_openai import AsyncOpenAI
async def main():
client = AsyncOpenAI()
response = await client.chat.completions.create(
model="qwen3-coder-flash",
messages=[{"role": "user", "content": "Write a Python fibonacci generator"}],
)
print(response.choices[0].message.content)
asyncio.run(main())
from ainative_openai import OpenAI
client = OpenAI()
stream = client.chat.completions.create(
model="deepseek-4-flash",
messages=[{"role": "user", "content": "Write a haiku about code"}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
from ainative_openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="meta-llama/Llama-3.3-70B-Instruct",
messages=[{"role": "user", "content": "What's the weather in Austin?"}],
tools=[{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather for a city",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"],
},
},
}],
)
| Model | ID |
|---|---|
| Llama 3.3 70B | meta-llama/Llama-3.3-70B-Instruct |
| Llama 4 Scout | meta-llama/Llama-4-Scout-17B-16E-Instruct |
| Qwen3 Coder Flash | qwen3-coder-flash |
| DeepSeek 4 Flash | deepseek-4-flash |
| Kimi K2 | kimi-k2 |
All models are free on AINative's API.
The client resolves API keys in this order:
api_key argumentAINATIVE_API_KEY environment variableOPENAI_API_KEY environment variable~/.ainative/config.json# Explicit key
client = OpenAI(api_key="your-ainative-key")
# Custom base URL (self-hosted)
client = OpenAI(api_key="key", base_url="http://localhost:8000/v1")
# Environment variables
# AINATIVE_API_KEY=your-key
# AINATIVE_BASE_URL=https://custom.endpoint/v1
- from openai import OpenAI
+ from ainative_openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
- model="gpt-4",
+ model="meta-llama/Llama-3.3-70B-Instruct",
messages=[{"role": "user", "content": "Hello!"}],
)
Every feature of the official openai SDK works — this is a thin subclass that only changes the defaults.
MIT
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
openaiEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | openai>=1.0 | runtime |
requestsEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | requests>=2.28 | runtime |
bdist_wheel · 6.78 KB · Python py3
sdist · 7.66 KB · Python source
Shared repository data · GitHub
Observed since 21 Oct, 11:26 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:febf958e7ea8e00880da3255e9016cd169f5b764b5145e3e22fa716038d7a21c