Skip to content

feat(ai): add Tzafon as a model provider#1309

Open
eddieogola wants to merge 5 commits intoinngest:mainfrom
eddieogola:feat/add-tzafon-model-provider
Open

feat(ai): add Tzafon as a model provider#1309
eddieogola wants to merge 5 commits intoinngest:mainfrom
eddieogola:feat/add-tzafon-model-provider

Conversation

@eddieogola
Copy link
Copy Markdown

@eddieogola eddieogola commented Feb 13, 2026

Summary

  • Adds a tzafon() model creator to @inngest/ai for Tzafon, an OpenAI-compatible LLM provider
  • Adds a custom "tzafon" format (following the Grok pattern) since Tzafon rejects tools/tool_choice parameters with HTTP 400
  • Adds TZAFON_API_KEY env key and exports from indexes

Files changed

File Change
packages/ai/src/models/tzafon.ts New model creator with format: "tzafon"
packages/ai/src/adapters/tzafon.ts New adapter interface extending AiAdapter
packages/ai/src/adapter.ts Add "tzafon" to Format union and AiAdapters map
packages/ai/src/adapters/index.ts Export TzafonAiAdapter
packages/ai/src/models/index.ts Export tzafon model
packages/ai/src/env.ts Add TzafonApiKey = "TZAFON_API_KEY"

Why a custom format instead of reusing openai-chat?

Tzafon is OpenAI-compatible for chat completions but does not support tool/function calling. When tools is included in a request, the API returns:

HTTP 400: "auto" tool choice requires --enable-auto-tool-choice and --tool-call-parser to be set

A custom "tzafon" format allows agent-kit to register a dedicated adapter that strips tools and tool_choice from requests (same pattern as Grok, which uses its own format to disable strict mode).

Usage

import { tzafon } from "@inngest/ai";

const model = tzafon({ model: "tzafon.sm-1" });
// => { url: "https://api.tzafon.ai/v1/chat/completions", format: "tzafon", ... }

Downstream PR

The corresponding agent-kit adapter PR is inngest/agent-kit#289.

Test plan

  • pnpm build compiles successfully
  • pnpm test — all 41 existing tests pass
  • Runtime verification: tzafon({ model: "tzafon.sm-1" }) returns correct adapter shape with format: "tzafon"
  • Live API test: chat completion request succeeds against https://api.tzafon.ai/v1

🤖 Generated with Claude Code


Note

Adds Tzafon as a new OpenAI-compatible model provider to @inngest/ai. Introduces a custom "tzafon" format (mirroring the Grok pattern) to allow downstream adapters to strip tools/tool_choice fields that Tzafon rejects with HTTP 400. Includes the model creator, adapter interface, env key, changeset, and all necessary index exports.

Written by Mendral for commit cc6b9f5.

Tzafon is an OpenAI-compatible LLM provider. This adds a `tzafon()`
model creator that reuses the `openai-chat` format, following the
same pattern as the existing DeepSeek integration.

Changes:
- New `src/models/tzafon.ts` model creator
- Add `TZAFON_API_KEY` to envKeys enum
- Export from models index

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 13, 2026

🦋 Changeset detected

Latest commit: e97240e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@inngest/ai Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

eddieogola and others added 2 commits February 13, 2026 11:16
Tzafon rejects requests containing `tools` or `tool_choice` (HTTP 400).
This changes the Tzafon model from reusing `openai-chat` format to using
its own `"tzafon"` format (following the Grok pattern), enabling
agent-kit to register a custom adapter that strips these fields.

Changes:
- New `src/adapters/tzafon.ts` adapter interface
- Add `"tzafon"` to `AiAdapter.Format` union and adapters map
- Update model creator to use `format: "tzafon"`
- Export adapter type from adapters index

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@eddieogola eddieogola marked this pull request as draft February 28, 2026 10:40
@eddieogola eddieogola marked this pull request as ready for review February 28, 2026 10:40
@eddieogola eddieogola marked this pull request as draft March 31, 2026 19:48
@eddieogola eddieogola marked this pull request as ready for review March 31, 2026 19:50
mendral-app[bot]

This comment was marked as outdated.

@eddieogola eddieogola marked this pull request as draft April 5, 2026 13:02
@eddieogola eddieogola marked this pull request as ready for review April 5, 2026 13:03
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