Repository navigation
AI/ML API as a cloud provider preset - #1
Open
Lookoff-AIMLAPI wants to merge 3 commits into
Open
Lookoff-AIMLAPI wants to merge 3 commits into
Lookoff-AIMLAPI wants to merge 3 commits into
Conversation
AI/ML API is an OpenAI-compatible aggregation gateway: one key reaches 300+ chat models (GPT, Claude, Gemini, Qwen, DeepSeek, Kimi, GLM, Grok), which is the same shape as the existing deepseek / seed / kimi / glm / grok presets — so it lands as one more CloudPreset rather than a new provider class. What this adds: - `aimlapi` cloud preset (base_url + default model + its own api key setting), wired through the settings page, the first-run wizard, the CLI (`--provider aimlapi`) and `autoclip providers`. - Attribution headers (`X-AIMLAPI-Source`, `HTTP-Referer`, `X-Title`) on requests to the gateway, gated on the exact hostname `api.aimlapi.com` so OpenRouter / Ollama / vLLM never receive them. - A model catalogue that filters the live `/models` list by `type`: the gateway returns 958 entries of which 367 are chat models, and the id alone does not say which is which. Also fixes a connectivity-test bug this surfaced: the probe asked for `max_tokens=1`, which reasoning models cannot finish, so the settings page reported "connection failed" for a perfectly good key. Measured 2026-09-23: openai/gpt-6-luna 400s at 1 token and answers at 16; claude-sonnet-5, gemini-3.8-flash and deepseek-v4-pro answer at 1. The probe now asks for 256. Verified against the live gateway: the request lands on api.aimlapi.com/v1/chat/completions carrying the attribution headers, the completion comes back, and the model dropdown resolves to 342 chat models with the curated ones first. Backend suite: 282 passed.
Registered as partnerName `autoclip`. The constant shipped empty because an unknown partner id is accepted and silently dropped upstream, which is indistinguishable from one that works; the test asserted empty-or-well-formed and now takes its other branch. Verified on the wire: the completion request carries X-AIMLAPI-Partner-ID alongside the source, referer and title.
The gateway shipped two flagships after this branch was written: openai/gpt-6.1-sol (2026-09-29) and anthropic/claude-sonnet-5.5 (2026-09-28), both measured on 2026-10-01 as text+image with tool calls. They replace their predecessors in the starter list rather than lengthening it; gpt-6-luna stays the default, since the work here is long subtitles and it is the cheap 1.05M-context option. The live /models list is unaffected either way: it is fetched and merged on top of this list whenever a key is present.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds AI/ML API to AutoClip as one more
CloudPreset, the same shape the existing deepseek / seed / kimi / glm / grok presets use.What lands
aimlapipreset: base URL, default modelopenai/gpt-6-luna, its ownaimlapi_api_keysetting — wired through the settings page, the first-run wizard, the CLI (--provider aimlapi),autoclip providers, env fallbacks (API_AIMLAPI_API_KEY/AIMLAPI_API_KEY) and the eight locale catalogues.X-AIMLAPI-Source: agent/autoclip,HTTP-Referer,X-Title) on requests to the gateway, gated on the exact hostnameapi.aimlapi.comso OpenRouter / Ollama / vLLM never receive them./modelslist bytype: the gateway returns 958 entries of which 367 are chat models, and the id alone does not say which is which.A real bug this surfaced. The connectivity probe asked for
max_tokens=1, which reasoning models cannot finish, so the settings page reported "connection failed" for a perfectly good key. Measured 2026-09-23:openai/gpt-6-luna400s at 1 token and answers at 16; claude-sonnet-5, gemini-3.8-flash and deepseek-v4-pro answer at 1. The probe now asks for 256.Verification. Live against the gateway: the request lands on
api.aimlapi.com/v1/chat/completionscarrying the attribution headers, the completion comes back, the dropdown resolves to 342 chat models with the curated ones first, and--provider aimlapi --api-keyreportsavailable: true. Backend suite 282 passed / 4 skipped; frontend typecheck, lint and i18n tests clean. The attribution test was proven to fail with the wiring removed.Open item.
AIMLAPI_PARTNER_IDships empty, with a test asserting empty-or-well-formed. An unknown partner id is accepted and silently dropped upstream, so a placeholder would look identical to a working one. One string edit once the id is minted.