Skip to main content

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 model
  • AimlapiLLM – text completion model
  • AimlapiEmbeddings – embeddings
  • AimlapiImageModel – image generation
  • AimlapiVideoModel – video generation
  • AIMLAPI_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")

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_aimlapi-0.1.2.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_aimlapi-0.1.2-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file langchain_aimlapi-0.1.2.tar.gz.

File metadata

  • Download URL: langchain_aimlapi-0.1.2.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.15

File hashes

Hashes for langchain_aimlapi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 dc6fc4894b022df1fb1626eb232e0f82fc97d9d0e985eb2f0e5753b06139e675
MD5 14c8716b8cb41434ac63ba355651b027
BLAKE2b-256 8eeec20307bba68f2525a80c30f306eec7859028f650180eab033a66738cdcec

See more details on using hashes here.

File details

Details for the file langchain_aimlapi-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_aimlapi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e5d0d72d7d67cee11d4352033ad00c2a2db6dca52333ff1df875e9245cc6281a
MD5 6dba1c860ce6e2310dc6721c651b8dee
BLAKE2b-256 89c2208b46b30ab731f78bb0b4e341b04ad86ea878a20ab7248275690fbc93ba

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 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