connect: ai& is a provider of its own, asked for a key and nothing else - #1736
Closed
fenilmodi00 wants to merge 1 commit into
Closed
fenilmodi00 wants to merge 1 commit into
fenilmodi00 wants to merge 1 commit into
Conversation
ai& (api.aiand.com) is a Japan-hosted, OpenAI- and Anthropic-compatible inference service selling one prepaid credit per token. Its list reaches models from several labs at once, so one key covers what would otherwise take four accounts. It needed exactly one row in modelsource.Vendored() and the rest of the product follows from that one fact: the connect panel, the providers group, the picker group, the Providers tab and `codeaf connect aiand` are all derived from the vendored catalog. Config.Direct already switches off the router's lane sheet, generation-receipt fetch, price ceiling and routing vocabulary, so the provider layer needed no change and a direct vendor stays a base-URL swap. internal/session needed none either — clientdoor.go keys its adapter pool on the resolved connection. TWO FACTS THE CATALOG ALONE DOES NOT GIVE. ai& is the first connection here that is itself a router: its ids already name the lab (`zai-org/glm-5.3`, `deepseek-ai/deepseek-v4.1-flash`), so a send is the provider segment over the vendor's own id. crewVendors maps a connection to the CATALOG's vendor words, because that is what the router weighs — but the catalog says `deepseek/` and `z-ai/` where ai& says `deepseek-ai/` and `zai-org/`. crewVendorWire carries that rename on the send. It is not a tidiness fix: a bare name was asked for on 2026-10-02 and answered 404 model_not_found for deepseek-v4-flash, glm-5.3-flash and kimi-k3, while the qualified ids answered 200. The same listing means `motif-technologies` and `google` are organisations no connected provider carries, so crew routing reaches neither. They are still pickable by hand, and the manual says so rather than implying coverage. The one-door claim is deliberate and says why in the row: nothing on the wire separates a plan from metered credit, which is MiniMax's position too. A 402 insufficient_credits is already read correctly by paymentrefusal's generic 402 rule. Verified live against the API on 2026-10-02: the listing, a streamed reply with its usage frame, tool calling, `max_tokens`, `stream_options`, and the refusal of a bare model name. Also observed and recorded because the docs imply otherwise: X-Cost is advertised in access-control-expose-headers and never sent, so a direct provider's cost cannot be read off a response.
Member
|
Hey, thanks for the PR. Could you sign the CLA when you get a chance so we can review it? |
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.
ai& is now a provider of its own. It is asked for a key and nothing else — no region, no plan door, no second question.
What is now true
ai&appears in theprovidersgroup in/connect, incodeaf connect aiand, and on the Providers tab in/settings. It asks foryour key, lists its models, and moves the conversation onto one of them at once the way every other provider does.aiand is connected · 13 modelsis the shape of the receipt — with the count being whatever answered that day, because the list is organised by organisation and moves as the vendor adds and retires them.It reaches models from several labs behind one key, so a person who would otherwise open four accounts opens one. Models are picked by hand from
/model; nothing here chooses one for a task or plans a crew around them.The whole change is one row, plus what that row exposed
internal/modelsource/modelsource.gogains a singleSource. Everything else follows from it: the connect panel, the providers group, the picker group, the Providers tab andcodeaf connectare all derived from the vendored catalog.Config.Directalready switches off the router's lane sheet, its generation-receipt fetch, its price ceiling and its routing vocabulary (internal/provider/client.go:258,receipt.go:169,velocity.go:284), sointernal/providerneeded no change and a direct vendor remains a base-URL swap.internal/sessionneeded none either —clientdoor.gokeys its adapter pool on the resolved connection.internal/taxonomyneeded none: a402is already classified bypaymentrefusal's generic rule.Two facts the catalog alone does not give
ai& is the first connection here that is itself a router. Its ids already name the lab —
zai-org/glm-5.3,deepseek-ai/deepseek-v4.1-flash.crewVendorsmaps a connection to the catalog's vendor words, because that is what the router weighs (internal/config/crew.go:791), and the catalog saysdeepseek/andz-ai/where ai& saysdeepseek-ai/andzai-org/. SocrewVendorWirecarries that rename on the send.This is not a tidiness fix. Asked on 2026-10-02:
Without the rename every crew seat on ai& would 404. Moonshot and Codex are absent from the table, so their sends are byte-identical to before.
Two of ai&'s seven organisations are carried by no connected provider.
motif-technologiesis unknown to this catalog;googleis a vendor word the catalog knows while no connection serves it. Both are still pickable by hand. The manual says so rather than implying coverage.The one-door claim is deliberate
Nothing on the wire separates a plan from metered credit — the same host, bearer, model and request spend the balance either way. That is MiniMax's position, and the row says so in the same terms: a money label codeaf cannot check is worse than none. A
402 insufficient_creditsis the balance speaking, not a bad key, and the existing refusal path already words it correctly.Verified against the live API on 2026-10-02
The listing, a streamed reply with its usage frame, tool calling,
max_tokens,stream_options.include_usage, the OpenAI/responsesand Anthropic/messagessurfaces, ephemeral cache breakpoints, the refusal of an unlistedreasoning_effort, and the refusal of a bare model name.One thing recorded because the docs imply otherwise:
X-Costis named inaccess-control-expose-headersand never sent on a 200, streamed or not. A direct provider's cost cannot be read off a response here, so this change claims none.Also unverified, and said so in the entry: whether
cache_controlactually caches on a repeat call, and a real402(needs an empty wallet).Tests
internal/modelsource's two index-coupled laws updated. The OllamaKeyOptionalcheck was readingrows[6]by position — inserting any row before it failed withonly Ollama may omit its key. It now looks the row up by id, so the next provider is free.New: a mutation-checked crew-send test, an
aiandcase inTestEveryOneDoorServiceKeepsItsHostAndBearer, andTestTheClientDoorReachesAiandWithItsBareVendorSlug— which proves the wire slug is the barezai-org/glm-5.3and notaiand/zai-org/glm-5.3, and that the direct vendor is asked for the chat road and nothing else.Known limits, stated rather than hidden
motif-technologiesandgooglemodels are pickable by hand but unroutable by crew.Preferred,Listing: ListingModels, emptyRegions). If any moves, that page is wrong.crewVendorWirecarries two spellings that are a table of facts from one day's listing. A future ai& change to either is a one-line edit there.make pr-readyis green. Twointernal/sessiontiming tests fail on the branch and are attributed away by the classifier because they fail identically on the base commit — they are #1664 ("the 40ms check-clock cut"), untouched by this change. Full suites and the tmux e2e were not run locally; CI runs them on the way tostaging.