langchain-aimlapi
This package contains the LangChain integration with Aimlapi. AI/ML API provides over 300 models including Deepseek, Gemini and ChatGPT. All models are served with enterprise-grade rate limits and uptimes via Aimlapi.
Installation
pip install -U langchain-aimlapi
Configure credentials by setting the environment variable:
AIMLAPI_API_KEY– your AI/ML API key
Available modules
The package exports the following classes:
ChatAimlapi– chat completion modelAimlapiLLM– text completion modelAimlapiEmbeddings– embeddingsAimlapiImageModel– image generationAimlapiVideoModel– video generationAIMLAPI_HEADERS– default request headers
All classes provide both synchronous and asynchronous APIs. See the docs/ folder for complete examples.
Chat Models
ChatAimlapi class exposes chat models from Aimlapi.
from langchain_aimlapi import ChatAimlapi
llm = ChatAimlapi()
llm.invoke("Sing a ballad of LangChain.")
Embeddings
AimlapiEmbeddings class exposes embeddings from Aimlapi.
from langchain_aimlapi import AimlapiEmbeddings
embeddings = AimlapiEmbeddings()
embeddings.embed_query("What is the meaning of life?")
LLMs
AimlapiLLM class exposes LLMs from Aimlapi.
from langchain_aimlapi import AimlapiLLM
llm = AimlapiLLM()
llm.invoke("The meaning of life is")
Image Generation
AimlapiImageModel generates images from prompts.
from langchain_aimlapi import AimlapiImageModel
img = AimlapiImageModel(
model="stable-diffusion-v3-medium",
size="512x512",
n=1,
)
img.invoke("A serene mountain lake at sunset")
Video Generation
AimlapiVideoModel generates short videos from prompts.
from langchain_aimlapi import AimlapiVideoModel
vid = AimlapiVideoModel(
model="veo2",
)
vid.invoke("A timelapse of city lights at night")
Metadata
Release files for langchain-aimlapi 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_aimlapi-0.1.3.tar.gz | 13.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_aimlapi-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.3 kB
Release files / langchain_aimlapi-0.1.3.tar.gz
| Download URL | langchain_aimlapi-0.1.3.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d140baf6a3a63a0206984c8465917c19c3eb8bf5b644bd28fb23cd64b5715ab
|
|
BLAKE2b-256 checksum How to use checksums |
1fff19778bfe6c83bbdb63a26f3c62fcf55fc79a2bf94e1917e66efec22eeb4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / langchain_aimlapi-0.1.3-py3-none-any.whl
| Download URL | langchain_aimlapi-0.1.3-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4227b5457e8d3f6391d4c05d4e0cff2d9670490f6119275fff22a6771955dee
|
|
BLAKE2b-256 checksum How to use checksums |
f1c60266df3561754aa9bd73fdc48c5884603dd3ea17e87f2f7f43b0f20439f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|