Repository navigation
feat(dothoosh): add provider - #696
Alirezajalilii wants to merge 1 commit into
Conversation
|
DotHoosh now serves the full vendor context windows and bills long prompts at the vendor's long-context tier. This commit (eafef3f) updates the values to match https://gateway.dothoosh.com/models. |
eafef3f to
99067f2
Compare
|
Pushed 8fe5a5c: the generator now fails (file untouched) when a served model has no prompt/completion price or when fewer than three usable models are left after filtering, and reads max_output_tokens when max_completion_tokens is 0 or null. The model list is regenerated from the live catalog: DeepSeek (deepseek-flash, deepseek-v4-pro) now lists tool support and is back. |
|
Pushed 2623f3c;
|
Add DotHoosh, an OpenAI-compatible gateway, as an openai-compat provider. cmd/dothoosh generates internal/providers/configs/dothoosh.json from the gateway's public, keyless model list; the Iran-hosted API is not reachable from GitHub runners, so it reads the public mirror of the same catalog. The generator keeps models served on Chat Completions with tool support, skips models that also list the Responses API, and refuses a short list, duplicate ids, a served model without prices, or a list that would drop more than a third of the checked-in models. Default large and small models are the highest and lowest output price in the list. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2623f3c to
99bc337
Compare
|
The branch is now a single commit on top of v0.52.83. Earlier comments cite hashes from the previous history. dothoosh.json is regenerated from the live public catalog (names, limits and prices come from the gateway; nothing is hand-written). |
CONTRIBUTING.md.Adds DotHoosh as an
openai-compatprovider. DotHoosh is an Iranian AI API gateway: users pay in Toman from a prepaid wallet. One key (DOTHOOSH_API_KEY, created at https://gateway.dothoosh.com/api-keys) serves an OpenAI-compatible API athttps://gateway.dothoosh.com/v1. Docs: https://gateway.dothoosh.com/docs.What changed:
cmd/dothoosh/main.gogeneratesinternal/providers/configs/dothoosh.jsonfrom the gateway's public model list (no key needed). The Iran-hosted API is not reachable from outside Iran, GitHub runners included, so the generator reads the public mirror of the same catalog,https://www.dothoosh.com/gateway/v1/models. Only ids, names, limits, prices, modalities and capability flags are copied. Run it withtask gen:dothooshorgo run ./cmd/dothoosh. It is wired intoTaskfile.yamland.github/workflows/update.ymllike the other generators.internal/providers/configs/dothoosh.jsonis generator output, not hand-edited. Modelnameis the listing's name (the id when the listing has none). Prices are per million tokens; cache write goes incost_per_1m_in_cachedand cache read incost_per_1m_out_cached, asCRUSH.mddescribes.internal/providers/providers.goembeds and registers it;pkg/catwalk/provider.goaddsInferenceProviderDotHooshto the constants and toKnownProviders()(TestKnownProvidersMatchesRegistrypasses).Which models are included: those served on Chat Completions that support tools and take text in and out. Left out on purpose:
type.Reasoning: the list does not carry a model's effort values, so reasoning models get
lowandhigh. Kimi K2.6 (on/off thinking toggle) and Kimi K2.7 Code (always on) take no effort, so they are listed as reasoning models without levels.Defaults: large is the model with the highest output price and small the one with the lowest, so a new model reaches the defaults without a code change. Today that is
kimi-k3(1M context) anddeepseek-flash.A short, duplicate-id or price-less list, or one that would drop more than a third of the models already in
dothoosh.json, is refused instead of overwriting the file.Testing:
go test ./...,go vet ./...andgolangci-lint run ./...pass on the head commit.cmd/dothoosh/main_test.gocovers the field mapping, the skip rules, the refusals and the retirement guard with inline fixtures.dothoosh.jsonbyte for byte.🤖 Generated with Claude Code