Skip to main content

Provider Recipes

This page turns the provider catalog into practical operator paths. Start with loong onboard if you do not have a working config yet. Use these recipes when you want to review, harden, or hand-tune what onboarding wrote. If you want the shared public provider-profile shape before the recipes become provider-specific, start with Configuration Patterns.

Start Here

Most operators only need one of these routes:

Hosted Provider Quick Map

Loong supports a broad hosted-provider catalog. Volcengine and BytePlus stay high in the order because they are a common first-run path, but the docs should keep the broader hosted map legible too.

Pick The Right Recipe

Shared Readback Loop

After each provider edit, use the same short verification loop:
If runtime models list fails but chat still works, that is usually a signal to pin provider.model, add preferred_models, or fix the provider route rather than pretending discovery is always available.

Reading Rule

  • Use this page to get from provider lane to concrete config quickly.
  • Start with Recipe 1 unless you already know you are in a coding-lane, gateway, local, or multi-profile case.
  • Use Configuration Patterns when you want the shared active_provider plus providers.<id> shape before the provider-specific walkthroughs.
  • Jump to Common Setups when provider choice only makes sense together with the delivery surface.
  • Come back to Providers And Models when you need the broader chooser or model-selection contract.

Need A Full Rollout Instead?

If the provider choice is already tied to a delivery surface, skip the narrower provider-only lane and jump straight to the matching playbook.

Recipe 1: One Hosted Provider Profile

This is the cleanest path when one hosted provider should own the current runtime. The exact built-in kind can be Volcengine, BytePlus, OpenAI, Anthropic, Gemini, DeepSeek, MiniMax, or another direct hosted family.

Platform-First Hosted: Volcengine Or BytePlus

BytePlus variant:
Secret reference rule:
  • api_key = { env = "ARK_API_KEY" } or api_key = { env = "BYTEPLUS_API_KEY" } means the runtime should read the secret from that env var.
  • api_key = "ARK_API_KEY" would mean the literal string ARK_API_KEY is the configured key.
Use this when:
  • one hosted provider should own first value cleanly
  • you want the runtime to keep model choice visible instead of burying it in a proxy story
  • you do not need multiple saved profiles yet
What to do next:
  1. Run loong doctor to verify credentials and route health.
  2. Run loong runtime models list once credentials are healthy.
  3. Keep model = "auto" during first setup, then pin an explicit model if you want deterministic behavior.
Operational notes:
  • volcengine and byteplus are the general hosted lanes, not the coding-plan lanes.
  • Volcengine defaults to ARK_API_KEY.
  • BytePlus defaults to BYTEPLUS_API_KEY and also accepts ARK_API_KEY as an alias.

Other Direct Hosted Families

The same provider-profile shape works for the broader direct-hosted set. Swap the built-in kind, the default credential env, and the reviewed model choice.
Representative direct-hosted variants: The broader direct-hosted catalog also includes qwen, kimi, zai, groq, fireworks, together, perplexity, qianfan, cerebras, nvidia, sambanova, novita, siliconflow, stepfun, and venice. Use the built-in provider kind, then let loong onboard or loong doctor surface the exact default credential env and readiness hints for that family.

Recipe 2: Dedicated Coding Lane

Use this lane when coding traffic should stay on the dedicated coding-plan route instead of the normal hosted chat lane. Volcengine Coding example:
BytePlus Coding variant:
Use this when:
  • coding quota or billing should stay separate from the normal hosted lane
  • your org expects the dedicated /api/coding/v3 route
  • you do not want a general hosted profile accidentally drifting into the wrong pricing path
Important boundary:
  • volcengine and byteplus belong to the general /api/v3 lane.
  • volcengine_coding and byteplus_coding belong to /api/coding/v3.
  • Do not point a general kind at the coding route, or a coding kind at the general route. Keep the provider kind and route family aligned so runtime validation and quota expectations match.
  • Other coding-specialized families such as kimi_coding, step_plan, and bailian_coding follow the same rule: keep a separate profile id, use the matching built-in kind, and pin a reviewed coding model instead of letting the general hosted lane absorb the traffic by accident.

Recipe 3: OpenAI-Compatible Gateway Or Managed Proxy

Use a built-in provider kind when Loong already knows the provider family. Use kind = "custom" when the endpoint is OpenAI-compatible but does not map to one of the built-in families.
Use this when:
  • the team runs a compatibility proxy in front of upstream providers
  • you are connecting to a managed gateway instead of a first-party provider
  • the provider route is stable, but the model catalog may live on a different endpoint
Important notes:
  • If the endpoint already maps to a built-in family such as openrouter, cloudflare_ai_gateway, or vercel_ai_gateway, prefer that built-in kind over custom.
  • Keep wire_api = "chat_completions" unless the endpoint really expects the Responses API.
  • If you set endpoint or models_endpoint explicitly, later base_url edits will not rewrite those routes for you.
  • If chat works but catalog probing fails, pin model explicitly and treat the catalog as optional recovery material rather than a hard requirement.

Recipe 4: Local Or Self-Hosted Provider

Loong has built-in kinds for several local and self-hosted lanes. Example with Ollama:
Example with a remote vLLM host:
Use this when:
  • you want local control over model hosting
  • one machine or one lab box owns the model runtime
  • you are willing to pin model names when catalog discovery is thin or absent
Practical guidance:
  • Start with model = "auto" only if the server exposes enough catalog information to make that useful.
  • If the server effectively has one production model, pin model explicitly and skip discovery drama.
  • Prefer a stable profile id such as local, gpu-lab, or lmstudio-dev instead of rewriting one profile back and forth.

Recipe 5: Keep Multiple Saved Provider Profiles

Loong supports provider profiles directly. That means you do not need to throw away a working profile when you add a second one.
Use this when:
  • general chat, coding work, and fallback review should stay explicit
  • some work should stay on one quota or region while other work should not
  • the team wants explicit provider choices instead of one profile being overwritten repeatedly
Recommended workflow:
  1. Keep profile ids semantic, such as ark_main, ark_coding, review_fallback, or ops_gateway.
  2. Change active_provider deliberately when you want to switch lanes.
  3. Re-run loong doctor after switching, because the active route and health checks should follow the active profile, not the last one you happened to edit.
You can build the same pattern with BytePlus, gateway, and local profiles too.

Recipe 6: Keep Auto Discovery, But Add Explicit Recovery

This is the right pattern when you like the onboarding path and dynamic catalog lookup, but you do not want the runtime inventing hidden defaults. DeepSeek example:
MiniMax global-region example:
Why this pattern matters:
  • preferred_models is an operator-owned fallback order, not a hidden provider default.
  • reviewed onboarding defaults currently exist for DeepSeek (deepseek-chat) and MiniMax (MiniMax-M2.7)
  • region-sensitive providers may need an explicit base_url that matches the account region
Region note:
  • MiniMax defaults to the CN endpoint https://api.minimaxi.com
  • the global MiniMax endpoint is https://api.minimax.io
  • if you later set provider.endpoint or provider.models_endpoint, changing only provider.base_url will no longer move those explicit overrides

Troubleshooting Patterns

Continue Reading