Skip to content

feat: add AI Code With (aicodewith) provider - #9426

Open
DengZY123 wants to merge 4 commits into
anomalyco:devfrom
DengZY123:add-aicodewith-provider
Open

DengZY123 wants to merge 4 commits into
anomalyco:devfrom
DengZY123:add-aicodewith-provider

Conversation

@DengZY123

Copy link
Copy Markdown

Adds AI Code With as a provider: an API gateway serving Claude, GPT, Gemini, Grok, DeepSeek, GLM and Kimi models.

  • OpenAI-compatible endpoint: https://api.aicodewith.ai/v1 (Claude models use the Anthropic format, GPT models the OpenAI Responses format, per the provider's api_format)
  • Env: AICODEWITH_API_KEY
  • Docs: https://docs.aicodewith.ai/zh/docs
  • 37 models, all using base_model. Context/output/modalities come from https://api.aicodewith.ai/models; pricing (per 1M tokens) comes from https://aicodewith.ai/zh/models. CNY-priced models are converted to USD, with the rate noted in each file.
  • bun run validate passes.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [critical] [violation] providers/aicodewith/models/claude-opus-4-6.toml:4 - Check: Relay reasoning_options must copy lab + same-surface peer controls, never [] from uncertainty. Why: All Claude entries set reasoning_options = [] with # Reasoning controls exposed by this relay are not documented; left unverified, while lab is reasoning = true and first-party providers/anthropic/models/claude-opus-4-6.toml has effort ["low","medium","high","max"] + budget_tokens, claude-sonnet-5.toml/claude-haiku-5-5.toml have toggle + effort ["low","medium","high","xhigh","max"], and providers/openrouter/models/anthropic/claude-opus-4.6.toml has toggle + effort + budget_tokens. [] asserts no caller control, contradicting evidence bar. Same applies to all other [] Claude files (claude-fable-5-1.toml:4, claude-fable-5.toml:4, claude-opus-4-7.toml:4, claude-opus-4-8.toml:4, claude-opus-5.toml:4, claude-opus-5-5.toml:4, claude-sonnet-4-6.toml:4, claude-sonnet-5-5.toml:4, claude-haiku-5-5.toml:5). Action: Replace [] with verified forwarded controls per host docs/test or lab+peer intersection; do not ship uncertainty [].
  • [critical] [violation] providers/aicodewith/models/gpt-5.5.toml:5 - Check: GPT relay effort baseline. Why: Sets [] unverified while models/openai/gpt-5.5.toml is reasoning = true and providers/openai/models/gpt-5.5.toml + providers/openrouter/models/openai/gpt-5.5.toml both use effort ["none","low","medium","high","xhigh"] with [[cost.tiers]] size 272_000. Same for gpt-5.6-sol.toml:4, gpt-5.6-terra.toml:4, gpt-6-astra.toml:4, gpt-6-sol.toml:4, gpt-6.1-sol.toml:4 (peers show ...,"max"] e.g. providers/openrouter/models/openai/gpt-5.6-sol.toml:4-6). Action: Author peer-matching effort with none (no toggle when none present) and document wire field, or provide affirmative no-control evidence.
  • [critical] [violation] providers/aicodewith/models/gemini-2.5-pro.toml:5 - Check: Non-GPT relay baselines (Gemini/DeepSeek/Grok/GLM). Why: Same unverified [] while labs are reasoning = true: providers/google/models/gemini-2.5-pro.toml uses budget_tokens 128..32768, providers/google/models/gemini-3.6-flash.toml uses effort ["minimal","low","medium","high"], providers/deepseek/models/deepseek-v4-pro.toml/deepseek-v4-flash.toml use toggle + effort ["low","high","max"], providers/xai/models/grok-4.5.toml/grok-4.7.toml use effort ["low","medium","high"]/["low","medium","high","xhigh"]. Applies also to gemini-3-pro-preview.toml:5, gemini-3.1-pro-preview.toml:5, gemini-3.5-flash.toml:5, deepseek-flash.toml:4, deepseek-v4-pro.toml:5, grok-4.5.toml:4, grok-4.6.toml:4, glm-5.1.toml:5, glm-5.3.toml:5. Action: Replace with lab/peer-matching options for this host's actual request surface; budget_tokens only with real reasoning-budget field.
  • [high] [possible mistake] providers/aicodewith/models/claude-haiku-4-5-20251001.toml:4 - Check: reasoning = false override must reflect real provider delta. Why: Lab models/anthropic/claude-haiku-4-5-20251001.toml:7 is reasoning = true; same contradiction for claude-sonnet-5.toml:4 (lab true), deepseek-v4-flash.toml:5 (labs deepseek-v4-flash/deepseek-v4.1-flash true), gemini-3.6-flash.toml:6/gemini-3.7-flash.toml:6/gemini-3.8-flash.toml:6 (labs true), glm-5.2.toml:6 (lab true), grok-4.7.toml:5 (lab true), kimi-k2.6.toml:5/kimi-k2.7-code.toml:5/kimi-k3.toml:5 (labs true, e.g. moonshotai/kimi-k3.toml:7). If false were correct, reasoning_options would be correctly omitted, but no evidence is given that this Anthropic/OpenAI-compatible relay disables reasoning. Action: Remove reasoning = false to inherit true and add proper reasoning_options, or cite provider evidence that this host serves a non-reasoning variant.
  • [high] [violation] providers/aicodewith/models/claude-haiku-5-5.toml:8 - Check: Context-based pricing must be [[cost.tiers]], not a comment. Why: Comment notes Above 100000 input tokens, higher long-context rates apply (input 0.5 / output 2.5) without tiers, while first-party providers/anthropic/models/claude-haiku-5-5.toml:20-24 encodes tier size 100_000. Same pattern in gpt-5.6-sol.toml:3/gpt-5.6-terra.toml:3/gpt-6-astra.toml:3/gpt-6-sol.toml:3/gpt-6.1-sol.toml:3 (272k tiers; cf. providers/openrouter/models/openai/gpt-5.5.toml:12-16, gpt-5.6-sol.toml:14-18) and grok-4.5.toml:3/grok-4.6.toml:3/grok-4.7.toml:3 (200k tiers; cf. providers/xai/models/grok-4.5.toml:12-16, grok-4.7.toml:13-17). Action: Encode noted higher bands as [[cost.tiers]] with input/output (+ cache where peer shows it) or remove the claim.
  • [medium] [violation] providers/aicodewith/models/claude-fable-5-1.toml:16 - Check: Override-only provider files after base_model. Why: [limit] context = 1_000_000 output = 128_000 is identical to models/anthropic/claude-fable-5-1.toml:16-17 (same for claude-fable-5.toml:15-18 vs models/anthropic/claude-fable-5.toml:14-15); identical tables must be omitted, deltas only. Action: Delete the redundant [limit] block (keep genuine [modalities] delta if verified, and cost/reasoning_options).

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/aicodewith/models/claude-haiku-5-5.toml:1 - Check: Every toggle requires a leading top-of-file exact wire path. Why: All toggle files (claude-haiku-5-5, claude-sonnet-5, deepseek-flash, deepseek-v4-flash, deepseek-v4-pro, glm-5.1, kimi-k2.6) carry only a generic mirror providers/... (relay forwards the upstream request body) comment with no wire field, so on/off control cannot be verified. Action: Add the exact per-surface wire comment (e.g. # Toggle: thinking.type = enabled|disabled) for each host format, or remove toggle if forwarding is unverified.
  • [high] [violation] providers/aicodewith/models/gemini-3-pro-preview.toml:5 - Check: Relay baseline must copy lab + same-surface peers; [] means affirmative no caller control, not uncertainty. Why: Lab google/gemini-3-pro-preview has reasoning = true with no Google provider entry, established relay providers/merge-gateway/models/google/gemini-3-pro-preview.toml exposes effort [low, high], but this file copies providers/anyapi/... [] with only a generic mirror comment. Action: Replace [] with the peer-supported effort set with host evidence, or provide affirmative proof this relay exposes no control.

@DengZY123

Copy link
Copy Markdown
Author

Thanks for the review — all six items addressed in 57fc671:

1–3. Replaced every reasoning_options = [] with the controls from the corresponding first-party provider file, or a same-model peer where none exists (anyapi for gemini-3-pro-preview, 302ai for deepseek-flash). AICodeWith is a pass-through relay, so upstream request fields are forwarded unchanged.
4. Dropped the reasoning = false overrides; the supports_reasoning flag in our /models endpoint is inaccurate for several models and is being fixed, so entries now inherit reasoning = true.
5. Encoded long-context pricing as [[cost.tiers]] from https://aicodewith.ai/zh/models (Haiku 5.5 >100K, GPT-5.6/6.x >272K, Grok >200K).
6. Removed [limit] tables that match the base model; the remaining ones are real deltas.

bun run validate passes.

CI required exact # Toggle comments on every toggle model and rejected
empty reasoning_options on gemini-3-pro-preview; mirror merge-gateway effort.
@DengZY123

Copy link
Copy Markdown
Author

Follow-up for the latest CI highs in 57fc671:

  1. Added leading # Toggle: thinking.type = … wire comments on every toggle model (claude-haiku-5-5, claude-sonnet-5, deepseek*, glm-5.1, kimi-k2.6), matching the Anthropic / DeepSeek / Zhipu / Moonshot request surfaces this relay forwards.
  2. Replaced gemini-3-pro-preview empty reasoning_options with effort ["low","high"] from providers/merge-gateway/models/google/gemini-3-pro-preview.toml (anyapi's [] was uncertainty, not affirmative no-control).

bun run validate passes.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [possible mistake] providers/aicodewith/models/kimi-k2.6.toml:1 - Check: Toggle wire path must match this host/lab API per AGENTS.md Reasoning options and audit skill. Why: File claims # Toggle: thinking.type = enabled|disabled, but same lab's providers/moonshotai/models/kimi-k3.toml states thinking.type is not supported and uses reasoning_effort = low|high|max; uniform thinking.type across Kimi/GLM files suggests unverified copy-paste, and wrong wire breaks toggle callers. Action: Verify Kimi toggle field on api.aicodewith.ai via host docs or live test and correct/remove toggle; cite wire source.
  • [high] [possible mistake] providers/aicodewith/models/glm-5.1.toml:1 - Check: Toggle wire path must match lab/host API. Why: File claims thinking.type = enabled|disabled, but providers/zhipuai/models/glm-5.1.toml and glm-5.2.toml expose toggle/effort via reasoning_effort/reasoning_content with no thinking.type (DeepSeek/Anthropic use thinking.type, Zhipuai does not); relay forwarding claim alone does not prove this wire. Action: Verify actual GLM on/off field on this relay and fix comment/toggle or drop toggle if binary off is unavailable.
  • [medium] [possible mistake] providers/aicodewith/models/grok-4.5.toml:12 - Check: [[cost.tiers]] size must be reachable within [limit]. Why: Final keeps [limit] context = 200_000 with tier = {type="context", size=200_000} (same in grok-4.6.toml, grok-4.7.toml); tier at exactly max context never triggers, while lab models/xai/grok-4.5.toml is 500_000 with tier 200_000 and peer providers/xai/models/grok-4.5.toml has no limit.context cap, indicating the 200_000 cap is likely a copied catalog max_tokens rather than context. Action: Verify relay context vs tier threshold from pricing/catalog and either inherit lab 500_000 context or correct/remove tier.
  • [medium] [possible mistake] providers/aicodewith/models/gpt-5.5.toml:12 - Check: Provider [limit] overrides must be real deltas, not stale copies. Why: File keeps context = 400_000 vs lab models/openai/gpt-5.5.toml 1_050_000, while sibling relay files gpt-5.6-sol/terra, gpt-6-astra/sol correctly inherit 1_050_000 and add 272_000 tiers; isolated 400_000 matches older GPT-5 window and leaves no tier where peers have one. Action: Verify 400_000 against https://api.aicodewith.ai/models for this ID and drop [limit] if relay serves full 1_050_000 (adding 272_000 tier if long-context pricing applies).

@DengZY123

Copy link
Copy Markdown
Author

Addressed the latest review in 1083842.

  1. kimi-k2.6 toggle: Moonshot docs list thinking.type = enabled|disabled for kimi-k2.6 and mark reasoning_effort as "Not supported" (models-overview, thinking models); providers/moonshotai/models/kimi-k2.6.toml also uses toggle. Live test on api.aicodewith.ai (2026-10-13): every variant (default, thinking enabled/disabled, reasoning_effort none/low/high, plus /v1/messages) returned 503 "model unavailable", so it could not be re-verified on the relay. Kept toggle per lab wire and added the doc citation and the test note to the file.
  2. glm-5.1 toggle: verified live on /v1/chat/completions. thinking.type=disabled -> 0 reasoning tokens, no reasoning_content; enabled/omitted -> reasoning_content with 120-195 reasoning tokens. reasoning_effort none/low/high still reasoned (116-160 tokens), so it is not an off switch. Kept toggle and added the result to the comment.
  3. grok-4.5/4.6/4.7 context: the relay pricing data publishes long_context_threshold: 200000 (input 4 / output 12) for all three, so requests above 200K are billed. The /models catalog says context_window: 200000, which conflicts with that. Removed the context = 200_000 override so context inherits the xai lab value (500K) and the tier can apply; kept output 65_536.
  4. gpt-5.5 context: https://api.aicodewith.ai/models still reports context_window: 400000, and the pricing data for gpt-5.5 has no long_context_pricing (gpt-5.6-sol has threshold 272000). Kept context 400_000 with no tier, and added input = 272_000 (context minus output, same split as the openai lab) because the inherited 922_000 was larger than the context.

bun validate passes locally.

@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

@github-actions github-actions Bot added the reviewer: ready Automated review found no actionable items label Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewer: ready Automated review found no actionable items

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant