Cobble is a drop-in replacement: same API shape, same SDKs, open models on sustainable infrastructure. A typical migration is three changed lines and one model-name swap.
The three lines
client = OpenAI(
base_url="https://api.cobble.network/v1", # was api.openai.com/v1
api_key=os.environ["COBBLE_API_KEY"], # was OPENAI_API_KEY
)
# model="gpt-4o-mini" → model="qwen/qwen3.6-27b"That's the entire code change. Everything else on this page is about choosing models and knowing the behavioral differences.
Model mapping
There's no exact equivalence between proprietary and open models — but there are sensible starting points by job:
| If you were using | Start with | Why |
|---|---|---|
| GPT-4o / GPT-5.x for reasoning & agents | qwen/qwen3.5-122b-a10b | Flagship-class reasoning, 256K context |
| GPT-4o-mini / small tier for general chat | qwen/qwen3.6-27b or gemma4/gemma4-26b-a4b | Strong quality at mid-tier cost |
| The cheapest tier for classification, routing, drafts | gemma4/gemma4-e2b or mistral/mistral-nemo-12b | 130–160 tok/s, pennies per million tokens |
| A coding model | deepseek/deepseek-v4-flash | 1M context, agentic coding specialist |
text-embedding-3-small | nomic/nomic-embed-1.5 | $0.01/1M tokens |
text-embedding-3-large | qwen/qwen3-embedding-8b | 32K context window |
Treat these as starting points and A/B your real prompts — open models differ more from each other than proprietary tiers do, and switching between them is a one-string change.
What behaves differently
- Token counts change. Different models use different tokenizers; the same prompt may be 10–20% more or fewer tokens. If you enforce
max_tokensbudgets or truncate context by token count, re-measure — don't port hardcoded numbers. - Prompts tuned for one model need a pass on another. System prompts with heavy "you are ChatGPT"-era steering often over-constrain open models. Start with your prompt as-is, then simplify.
- JSON mode and tool calling work, but validate. All catalog generative models support the standard
toolsandresponse_formatparameters; smaller models are less reliable at complex nested schemas. If structured output matters, test at your target model size. - Unsupported OpenAI parameters are ignored, not rejected. Requests won't fail on OpenAI-specific extras, but features like the Assistants API, built-in web search, or proprietary file tooling have no equivalent here — Cobble is the inference layer; orchestration stays in your code or agent framework.
- No data leaves for model training. Your prompts and outputs are not used to train anything.
Migration checklist
- Create a key, set
COBBLE_API_KEY, verify with the quickstart curl. - Change base URL and key in one non-critical service.
- Pick the mapped model; run your existing eval or a golden-prompt set against it.
- Compare cost: your plan window covers steady traffic; spiky overflow bills from the wallet at catalog rates.
- Ship, watch error rates for a day, then migrate the rest.
Coming from OpenRouter or another router? Even less changes — your model IDs are likely already in org/model format; check them against /v1/models.
