Skip to content

feat: 0.11.0 — provider typespec parity + grok-4.20 catalog#33

Merged
chrisohalloran merged 2 commits intomainfrom
feat/provider-typespec-parity
Apr 21, 2026
Merged

feat: 0.11.0 — provider typespec parity + grok-4.20 catalog#33
chrisohalloran merged 2 commits intomainfrom
feat/provider-typespec-parity

Conversation

@chrisohalloran
Copy link
Copy Markdown
Contributor

Summary

Batches two changes into the `0.11.0` release:

  1. Provider typespec parity — this PR
  2. grok-4.20 catalog entry — already on main (PR feat(xai): add grok-4.20 family to the model catalog #32)

The CHANGELOG and version bump reflect both.

Why 0.11.0 (minor, not patch)

The new typespecs are user-visible via dialyzer — consumers who type-check their config maps will now get errors at call sites for typos and shape mismatches on all six providers. That's not strictly breaking (invalid configs failed at runtime before), but it's visible enough to warrant a minor bump rather than a patch.

Provider typespec parity

Before this PR, only `Alloy.Provider.Codex` had typespecs on its public API:

Provider `@spec` `@type`
codex.ex 2 ✓ 1 ✓
anthropic.ex 0 0
gemini.ex 0 0
openai.ex 0 0
openai_compat.ex 0 0
xai.ex 0 0

After this PR, all six match:

Provider `@spec` `@type`
All six 2 ✓ 1 ✓

Config types faithfully track the moduledoc

Each provider's `@type config` enumerates every option documented in its moduledoc, with proper types:

  • Anthropic: adds `:extended_thinking` (keyword), `:on_event` (function), `:cache` (boolean), etc.
  • Gemini: covers `:generation_config`, `:tool_config`, `:safety_settings` as maps.
  • OpenAI: the widest surface — covers provider-state plumbing (`:provider_state`, `:previous_response_id`), native tools (`:web_search`, `:x_search`, `:built_in_tools`), and Responses API controls (`:store`, `:include`, `:tool_choice`, `:parallel_tool_calls`).
  • OpenAICompat: correctly models the `:api_url` required / `:api_key` optional inversion for local-only providers like Ollama.
  • XAI: aliased to `Alloy.Provider.OpenAI.config()` since it's a thin wrapper that inherits the full OpenAI surface.

Test plan

  • `mix format --check-formatted`
  • `mix compile --warnings-as-errors` — clean
  • `mix credo --strict` — 996 mods/funs, 0 issues
  • `mix test` — 569 tests, 0 failures
  • `mix dialyzer` — 0 errors (PLT re-built with new specs)

Release flow

Merge this PR, then:

```
git tag v0.11.0
git push origin v0.11.0
```

That triggers `publish.yml` which tests and publishes to Hex.

🤖 Generated with Claude Code

Adds `@type config` and `@spec complete/3` + `@spec stream/4` to every
provider that implements the `Alloy.Provider` behaviour, matching the
pattern already in `Alloy.Provider.Codex`:

- `Alloy.Provider.Anthropic`
- `Alloy.Provider.Gemini`
- `Alloy.Provider.OpenAI`
- `Alloy.Provider.OpenAICompat`
- `Alloy.Provider.XAI`

Purely a tooling-visibility improvement — no runtime change. Users who
run dialyzer now get type-checking at call sites for all six providers
(previously only Codex). The config types faithfully track the options
documented in each provider's moduledoc, so they double as
machine-readable contracts.

`Alloy.Provider.XAI.config/0` is aliased to `Alloy.Provider.OpenAI.config/0`
since XAI is a thin wrapper that inherits the full OpenAI config surface.

Bundles the already-merged grok-4.20 catalog entry (PR #32) and bumps
the version to 0.11.0. Minor bump — the new typespecs are user-visible
via dialyzer even though not breaking.

Verified: `mix format --check-formatted`, `mix compile --warnings-as-errors`,
`mix credo --strict`, `mix test` (569/569), `mix dialyzer` (0 errors).
- Version string in the opening example: 0.10.0 → 0.11.0
- Deps pin: `~> 0.10` → `~> 0.11`
- Four xAI code examples now use `grok-4.20-0309-reasoning`
  (the current API frontier per docs.x.ai/developers/models,
  catalogued in this release) instead of `grok-4`
- Providers table xAI row: add `grok-4.20-0309-reasoning` and
  `grok-4.20-multi-agent-0309` to the example models column
@chrisohalloran chrisohalloran merged commit d4b0367 into main Apr 21, 2026
1 check passed
@chrisohalloran chrisohalloran deleted the feat/provider-typespec-parity branch April 21, 2026 02:12
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.

1 participant