Skip to content

feat: add Celeris provider - #10714

Merged
alexhancock merged 2 commits into
aaif-goose:mainfrom
tomhamer:feat/celeris-provider
Aug 5, 2026
Merged

feat: add Celeris provider#10714
alexhancock merged 2 commits into
aaif-goose:mainfrom
tomhamer:feat/celeris-provider

Conversation

@tomhamer

Copy link
Copy Markdown
Contributor

Summary

Adds Celeris as a declarative OpenAI-compatible provider — one JSON definition plus a line in the expose_declarative_providers! list, following the same shape as the Fireworks, EmpirioLabs and OrcaRouter additions.

Celeris serves diffusion-based language models over an OpenAI-compatible chat-completions API, aimed at low-latency short responses. celeris-1 is the only model served today.

Disclosure: I work with Celeris — this is a vendor-submitted integration and I'll maintain it. Flagging that up front so you can weight the review accordingly. The definition was drafted with AI assistance and then verified by hand against the live API; I've read the contributing guide and kept this to the smallest change that does the job.

A known limitation you should weigh before merging

I'd rather you hear this from me than find it later.

The Celeris API rejects any max_tokens that isn't 1 or a positive multiple of 256:

400 max_tokens must be 1 (warm ping) or a positive multiple of 256, got 100

The declarative provider format has no hook for transforming request parameters, so this constraint can't be enforced from the JSON definition. What that means in practice:

  • Default path is safe. With no max_tokens configured, ModelConfig::with_canonical_limits fills it from the canonical catalog's limit.output. I've submitted the models.dev entry with limit.output = 4096 — 256-aligned — precisely so this path stays valid (anomalyco/models.dev#3757). Before that entry lands, max_tokens stays None and isn't sent at all, which is also fine.
  • User override is not safe. If someone sets a custom max_tokens that isn't 256-aligned, every request to Celeris returns a 400, and nothing in the current architecture catches it.

The clean general fix is a max_tokens_multiple field on the declarative definition applied in sanitize_request_for_compat, which would serve any provider with a quantized limit rather than just this one. That touches shared code, so I didn't want to bundle it into a first contribution unasked. Happy to open an issue or send it as a follow-up if you think it's worth having — equally happy for you to tell me the sharp edge is acceptable for now.

Other constraints worth knowing

  • context_limit is 8192 and it's shared between prompt and completion — not 8K in plus 8K out. A 7,169-token prompt with max_tokens: 1024 returns a 400. That makes this a poor fit as a primary coding model and a reasonable one for short, fast turns.
  • No response_format — no JSON mode or JSON-schema output. Structured output has to route through tool calling, which does work.
  • skip_canonical_filtering is set because Celeris serves exactly one model per base URL and /models requires auth.
  • base_url is pinned to https://inference.celeris.ai/celeris-1/v1 because the model id is part of the URL path.

Testing

  • cargo check -p goose-providers — clean.
  • cargo test -p goose-providers --lib declarative10 passed, including all_bundled_providers_are_valid and expose_declarative_providers_enumerates_all_bundled_json_files.
  • Manually verified against the live API: basic completion, streaming, and tool calling all work, and both 400 paths above reproduce as described.

Related Issues

None — happy to file one first if you'd prefer that order.

Celeris serves diffusion-based language models over an OpenAI-compatible
chat-completions API at https://inference.celeris.ai/<model>/v1.

celeris-1 has an 8192-token context shared between prompt and completion,
and the base URL pins the model in its path, so skip_canonical_filtering
is set and the model list is static.

Known limitation: the API rejects any max_tokens that is not 1 or a
positive multiple of 256. The declarative format has no request-transform
hook, so a user-configured non-aligned max_tokens will 400. The default
path is safe via the canonical catalog's 256-aligned limit.output.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd9491b43c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@@ -0,0 +1,20 @@
{
"name": "celeris",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Enforce Celeris max-token granularity

When GOOSE_MAX_TOKENS is set to a positive value that is not 1 or a multiple of 256 (including documented examples such as 16000), materialize_model_config_inner accepts it and the OpenAI formatter forwards it unchanged, so every Celeris request fails with HTTP 400. Normalize or reject incompatible values for this provider before exposing it as supported.

Useful? React with 👍 / 👎.

expose_declarative_providers!(
alibaba,
atomic_chat,
celeris,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the required provider feature self-test

This line exposes a new bundled provider, but the commit leaves goose-self-test.yaml unchanged, so the repository-required feature-level validation does not cover the integration or its unusual request constraints. Add an appropriate Celeris validation scenario to the self-test recipe before exposing the provider.

AGENTS.md reference: AGENTS.md:L71-L71

Useful? React with 👍 / 👎.

The previous copy framed celeris-1 as a speciality model for short structured
responses. It is a general-purpose model, so describe what it is and how it
differs from autoregressive models rather than narrowing it to one use case.

No functional change; technical constraints are documented exactly as before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dda79305aa

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"api_key_env": "CELERIS_API_KEY",
"base_url": "https://inference.celeris.ai/celeris-1/v1",
"models": [
{ "name": "celeris-1", "context_limit": 8192 }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reserve Celeris output tokens before advertising 8K context

With the default auto-compaction threshold (0.8) and no GOOSE_MAX_TOKENS/canonical limit, Goose sends no max_tokens, so a session around 6.2K–6.5K prompt tokens is considered under the 8,192-token limit and skips compaction. The Celeris API reference says omitted max_tokens defaults to 2,048 and prompt tokens plus max_tokens must be at most 8,192, so those requests will 400 before Goose compacts; either advertise an effective input budget here or add provider-specific handling that reserves/sizes the output budget.

Useful? React with 👍 / 👎.

@alexhancock alexhancock self-assigned this Jul 30, 2026
@alexhancock

Copy link
Copy Markdown
Collaborator

Can you clarify the known limitation around why max tokens needs to be a multiple of 256 and why the context limit is so low compared to what is advertised on https://docs.celeris.ai/api-reference#request-body-1?

@alexhancock
alexhancock self-requested a review August 5, 2026 14:15
@alexhancock
alexhancock merged commit 73798f0 into aaif-goose:main Aug 5, 2026
25 checks passed
lifeizhou-ap added a commit that referenced this pull request Aug 6, 2026
* main: (32 commits)
  fix: keep turn-context in place for OpenAI Responses-stack models so prompt caching works (#10993)
  fix(developer): byte-bound the shell truncation preview (#10992)
  fix(openrouter): stop silently ignoring thinking effort off (#10991)
  fix: dispatch edited queued messages (#10933)
  fix: contain recipe template paths (#10930)
  fix: make shell approval titles faithful (#10986)
  fix: block MCP app form submissions (#10985)
  fix: migrate desktop routing to React Router 8.3.0 (#10971)
  fix: sanitize Bedrock tool errors (#10934)
  fix implicit OAuth during model discovery (#10929)
  fix: update React Router to 7.18.2 (#10967)
  test: early-exit code-exec smoke tests once tool invocation is observed (#10954)
  fix: keep ACP session naming out of live conversations (#10963)
  Bind MCP apps to trusted ownership metadata (#10747)
  tests: add recursion_limit attribute to remaining ACP test files (#10559)
  Sanitize Unicode tags in MCP resources (#10746)
  fix(oauth): preserve RFC 9207 iss from MCP OAuth callback (#10678)
  feat(installer): detect Termux and select musl portable build (#10568)
  feat: add Celeris provider (#10714)
  fix: shell ACP providers on desktop (#10907)
  ...
lifeizhou-ap added a commit that referenced this pull request Aug 6, 2026
* main: (101 commits)
  fix: keep turn-context in place for OpenAI Responses-stack models so prompt caching works (#10993)
  fix(developer): byte-bound the shell truncation preview (#10992)
  fix(openrouter): stop silently ignoring thinking effort off (#10991)
  fix: dispatch edited queued messages (#10933)
  fix: contain recipe template paths (#10930)
  fix: make shell approval titles faithful (#10986)
  fix: block MCP app form submissions (#10985)
  fix: migrate desktop routing to React Router 8.3.0 (#10971)
  fix: sanitize Bedrock tool errors (#10934)
  fix implicit OAuth during model discovery (#10929)
  fix: update React Router to 7.18.2 (#10967)
  test: early-exit code-exec smoke tests once tool invocation is observed (#10954)
  fix: keep ACP session naming out of live conversations (#10963)
  Bind MCP apps to trusted ownership metadata (#10747)
  tests: add recursion_limit attribute to remaining ACP test files (#10559)
  Sanitize Unicode tags in MCP resources (#10746)
  fix(oauth): preserve RFC 9207 iss from MCP OAuth callback (#10678)
  feat(installer): detect Termux and select musl portable build (#10568)
  feat: add Celeris provider (#10714)
  fix: shell ACP providers on desktop (#10907)
  ...
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.

2 participants