feat(llm): add aimlapi.com as an LLM endpoint with partner attribution - #444
hugoaimlapi wants to merge 13 commits into
Conversation
|
hey team! just kindly ping about the PR, let me know if you have any questions |
|
Hi Hugo, thanks for putting this PR together and for your interest in EverOS! At this stage, we’re focused on developing the open-source project and aren’t pursuing revenue-sharing or commercial promotional partnerships. We’ll keep your proposal in mind and reconnect if that changes. Thanks again for reaching out and contributing! |
|
hi! got it, if it possible I'd like to connect with your team in Slack/mail/Telegram - I think there're a lot of ways we can work together without commercial stuff too (for example marketing, we have 1,5M impressions on X and 250k on LinkedIn - only for the last 30 days) contacts: hugo@aimlapi.com (Slack/Mail), @hug0the (Telegram) |
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 supported provider option inside EverOS — so we went ahead and did all the technical work on our side.
To build our partnership, we offer a 50/50 revenue share on all traffic from this integration. (P.S.: tracking starts as soon as this release goes live, so no earnings will be lost during setup)
My contacts: hugo@aimlapi.com (email / Slack), Telegram: @hug0the
Summary
Why. EverOS reaches every model through the same OpenAI-protocol clients, so an aimlapi.com key already works today by setting
base_urlalone. What doesn't work is attribution: aimlapi.com credits the project that sent the traffic only when the request carries partner headers, and a missing header fails silently — the call succeeds, the credit is simply lost. The docs also read as if OpenRouter were a dependency rather than one choice of OpenAI-protocol endpoint.What changed.
src/everos/component/utils/attribution.py(new): origin-scoped helpers.aimlapi_headers()/aimlapi_request_extra()return the partner headers (X-AIMLAPI-Partner-ID,X-AIMLAPI-Source,HTTP-Referer,X-Title) only when the parsed hostname ofbase_urlisaimlapi.comor a subdomain of it (dot-boundary match, so a lookalike host likeapi.aimlapi.com.example.netcollects nothing), and an empty mapping for every other host — as a fresh dict each call.src/everos/component/llm/client.py: the LLM and multimodal clients pass the headers through everalgo'sLLMConfig.extraasextra_headers; the attribution mapping merges under[llm].extra, so a user-configured key wins on collision. For every non-aimlapi endpoint no request key is added at all.src/everos/component/llm/openai_provider.py:default_headerson theAsyncOpenAIclient whenbase_urlis an aimlapi.com host — this also covers the decider client, which is built onOpenAIProvider.src/everos/component/embedding/openai_provider.py: samedefault_headerswiring.docs/configuration.md: a "Provider endpoints" table under[llm](aimlapi.com / OpenRouter — samevendor/modelslug convention, so the shipped[llm]default works unchanged), plus a recorded known limitation: the image parts EverOS sends carryimage_url.detail = null, which aimlapi.com rejects with HTTP 400, so[multimodal]should stay on a provider that tolerates it. Endpoint comments inconfig.example.toml,src/everos/config/default.toml, and.env.example+src/everos/templates/env.template(regenerated together, per themake docs-checkgate).tests/unit/test_component/test_utils/test_attribution.py(header shape, partner-id pattern, origin scoping incl. lookalike hosts, fresh-dict contract),tests/unit/test_component/test_llm/test_attribution_wiring.py(each client construction site forwards the headers; other providers get no extra request key;[llm].extraoverrides), and one case in the embedding provider tests.Defaults are unchanged:
base_urlstill points at OpenRouter everywhere; aimlapi.com is documented as an alternative. No new dependencies, no env vars touched.Area
Verification
The shipped
[llm]default (openai/gpt-4.1-mini) was called live against aimlapi.com through the component/llm client path, structured-output (response_format) path included.Checklist
main..envfiles, dependency folders, or generated output.Notes for Reviewers
HTTP-Referer/X-Titlename the host project (EverOS), the same convention OpenRouter uses for app attribution.By submitting this pull request, I agree that my contribution is licensed under
the Apache License 2.0.