Skip to content

Integration request from aimlapi.com - #535

Open
hugoaimlapi wants to merge 1 commit into
VectifyAI:mainfrom
aimlapi:docs/aimlapi-provider-upstream
Open

hugoaimlapi wants to merge 1 commit into
VectifyAI:mainfrom
aimlapi:docs/aimlapi-provider-upstream

Conversation

@hugoaimlapi

Copy link
Copy Markdown

Hi! I'm Hugo from aimlapi.com — an AI aggregator that gives access to 1000+ models in one API, trusted by 400k+ users.

We'd love to be available as a verified provider option inside PageIndex — so we went ahead and did all the technical work on our side, in our fork: https://github.com/aimlapi/PageIndex-aimlapi

To build our partnership, we offer a 50/50 revenue share on all traffic from this integration.

My contacts: hugo@aimlapi.com (email / Slack), Telegram: @hug0the


Why

PageIndex passes provider/model names to LiteLLM, so any LiteLLM provider already works for index= and chat=. The README doesn't say so, or which env var each provider reads. The two roles also want different models (a basic one for indexing, the best you can afford for chat), and with a gateway both come from one key.

What changed

README only, +20 lines: a "Model Providers" subsection under "Model Recommendations".

  • Naming rule: a bare name is an OpenAI model; provider/model goes to that LiteLLM provider, which reads its own key from the environment.
  • Example with aimlapi.com through LiteLLM's aiml/ prefix: AIML_API_KEY in the environment, index="aiml/openai/gpt-4o-mini", chat="aiml/anthropic/claude-sonnet-4.5".
  • Where the model ids come from (GET https://api.aimlapi.com/v1/models), AIML_API_BASE to override the endpoint, and how to keep the key out of the environment: index_model=/chat_model= with index_backend={"api_key": ...} and chat_backend={"api_key": ...}.

No code changes, nothing added to requests.

How to test

pip install -r requirements.txt   # litellm==1.97.0 ships the aiml provider
export AIML_API_KEY=...           # aimlapi.com key
from pageindex import PageIndexClient

client = PageIndexClient(
    index="aiml/openai/gpt-4o-mini",
    chat="aiml/anthropic/claude-sonnet-4.5",
)
doc_id = client.submit_document("report.pdf")["doc_id"]
print(client.chat("What was the 2023 operating margin?", doc_id=doc_id))

Indexing and the answer should both complete with only AIML_API_KEY set.

Notes

  • LiteLLM's aiml provider (AIML_API_KEY, AIML_API_BASE, default https://api.aimlapi.com/v1) is in the pinned litellm 1.97.0, so no dependency change.
  • The model ids used in the README are in the live catalog.

PageIndex already routes every non-OpenAI model through LiteLLM, so an
aggregator works today with no code change — but nothing in the README says
so, and the two roles pull in opposite directions: the index model wants to
be cheap, the chat model wants to be the best available. Sourcing both from
one OpenAI-compatible account removes a second key and a second billing
relationship from that decision.

Documents the aiml/ prefix, the AIML_API_KEY name LiteLLM actually reads
(not AIMLAPI_API_KEY), and the per-lane backend= escape for callers who
keep keys out of the environment.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant