Urgent.News

What's breaking now, across thousands of outlets.

AI

OpenCode and Kilo Code With Any OpenAI-Compatible Provider: Config Files That Work, and the Context Limit Trap

OpenCode and Kilo Code both let you add your own OpenAI-compatible provider, and both configs look simple. The part that bit me wasn't the URL or the key. It was a missing limit block that made long sessions fall over an hour in, with no obvious cause. Here are the configs I use and the mistakes I made getting there. My examples point at APIClaw , an OpenAI-compatible gateway I build, so weigh…

OpenCode and Kilo Code enable the use of custom OpenAI-compatible providers by allowing users to configure their own provider settings. The common mistakes involve missing or incorrect details such as the limit block, base URL, model ID, and environment variable. The limit block is crucial as it defines the context window and max output tokens for the model.

Without it, long sessions will fail due to the "context limit trap". The base URL should end with /v1, and the key should be stored in an environment variable and referenced as {env:NAME}. The model ID must match the exact ID returned from GET /v1/models. If these details are incorrect, the system will return an invalid API key (401) or model not found (404) error.

Additionally, forgetting to set the limit block in the configuration will result in the client not knowing the context window, causing compaction issues in Kilo Code, and eventually leading to the provider rejecting requests due to being too long.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

We Built HUNT: An AI-Powered Job Search Agent That Does More Than Find Jobs

We Built HUNT: An AI-Powered Job Search Agent That Does More Than Find Jobs Explore HUNT: https://gohunt.careers/ By AgenticGenie — Building AI-powered products that solve real-world problems.

  • HUNT is an AI-powered job-search agent designed to streamline the job search process.
  • The platform curates relevant job opportunities based on user preferences and career goals.

Generic AI Outreach Is a Context Problem

I want to show you two outputs from the same model. Same LLM. Same temperature. Same system prompt structure. Same signal: a company just posted three new SDR job listings.

  • Output A lacks clear connection to recipient's concerns
  • Output B tailored to VP of Sales persona and ramp time issue
  • Context specificity crucial for effective AI-generated outreach

More from Friday 9 October →