Technical report · October 2026
Junctra: one conversation across local and cloud language models
junctra.ai
Abstract
Most turns in a chat conversation do not need a frontier model, but moving one conversation between a local model and a cloud model is hard to do without losing context, breaking the stream, or paying for the history twice. Junctra is an OpenAI-compatible endpoint that holds the conversation so that any turn, or a reply already in progress, can move between models. I test nine hypotheses against real models (a local Gemma 4 26B and cloud Claude Sonnet 5). A hybrid session costs 97% less than cloud-only. Across 801 scripted conversations, switching models changed how much context was kept by at most 1 percentage point (95% intervals within ±3) against single-model controls, and in 150 runs of multi-step agent tasks a model finished another provider's task, with its tool calls and results, at least as reliably as working alone. A reply cut off mid-stream is taken over in 805 ms (median), and 1.3% of 300 takeovers left a visible seam (95% upper bound 3.4%). Local answers were judged acceptable 91% of the time, against 97% for the cloud model. Five of six targets set before the build were met; the sixth was met for one of two providers.
1Introduction
A capable local model answers most everyday prompts faster and for a fraction of the cost of a frontier model; a minority of prompts need the frontier model. Serving one conversation from both is possible in principle and difficult in practice. Backends stream and report usage in different shapes, provider prompt caches miss when history is re-sent slightly differently, and a model that fails partway through a reply normally surfaces as an error, discarding what the user has already read.
Junctra is a single OpenAI-compatible endpoint that owns the conversation. A client changes only its base URL. Each turn can be served by a different model, and a reply in progress can be continued by another model on the same connection. This report measures whether that works, what it saves, and what it costs. It describes what was measured and how.
Contributions. (i) Cost, quality, latency and reliability measurements of hybrid serving against real backends; (ii) controlled evaluations of whether context, and an agent task in progress, survive a change of model; (iii) a certification that mid-reply takeovers stay under a 5% visible-seam rate; (iv) the losses, stated alongside the gains.
2Hypotheses
Targets were fixed before the build where a threshold was meaningful. Table 1 summarises the outcome of each; Section 4 gives the evidence.
| No. | Hypothesis | Target | Measured | Outcome |
|---|---|---|---|---|
| H1 | A hybrid session costs less than cloud-only | — | −97% | Supported |
| H2 | Local answers are good enough to use | — | 91% vs 97% acceptable | Partly |
| H3 | Context survives a change of model | No loss vs single-model | ≤ 1 pt (95% CI ±3) | Supported |
| H4 | An agent task survives a change of model | No loss vs single-model | 100% vs 100%; 83% vs 73% | Supported |
| H5 | A mid-reply takeover is fast | Proxy share < 500 ms | ~370 ms (805 ms total) | Supported |
| H6 | Takeovers rarely leave a visible seam | < 5% | 1.3% (UB 3.4%) | Supported |
| H7 | Prompt caching survives the proxy | > 95% read | 99% / 93% | Partly |
| H8 | The proxy adds negligible latency | < 25 ms p95 | 4.0 ms | Supported |
| H9 | Clients never see a broken stream | 0 | 0 of 9 scenarios | Supported |
3Experimental setup
Models and hardware. Local: Gemma 4 26B-A4B (4-bit) on an Apple M5 Max. Cloud: Claude Sonnet 5 through OpenRouter; GPT models where noted. Takeover candidates: Gemma 4 31B, Claude Sonnet 5, GPT-5.4 nano, Ministral 8B. All measurements were taken between 27 September and 3 October 2026 against the live services.
Cost accounting. Cloud costs are the provider's reported cost per response, which matched the provider's billing to within 1%. Local turns are priced as electricity plus amortised hardware, never as free. Cloud-only figures come from real cloud-only runs, not estimates.
Judging. Where a result needs reading rather than counting, two judges from different model families (Claude Opus 5.5 and GPT-5.5) grade blind: they are not told which model wrote a response, or whether a model was switched. Pairwise comparisons are judged in both orders to cancel position bias. Anything code can decide (a number, a name, a format) is decided by code. Every evaluation includes a control that shows it can detect the failure it looks for.
Statistics. Rates from small samples are reported with an exact 95% binomial upper bound. Differences between conditions are paired by case, with 95% percentile-bootstrap intervals over cases. A case, not a repetition, is the unit of analysis.
4Results
4.1Cost (H1)
Ten four-turn conversations were run three ways (30 sessions, 120 turns) with full-length answers. With the local model healthy, a hybrid session cost $0.00117 against $0.03693 for cloud-only (−97%), and its first token arrived about ten times sooner. With the local model failing mid-reply on one turn in four, the saving fell to 57%: a takeover is billed at cloud rates, and repeated failures send later turns to the cloud as well.
Data
| Condition | Cost per session | vs cloud-only | First token (p50) |
|---|---|---|---|
| Hybrid, local healthy | $0.00117 | −97% | 290 ms |
| Hybrid, local failing 1 turn in 4 | $0.01577 | −57% | 330 ms |
| Cloud-only (Claude Sonnet 5) | $0.03693 | — | 2,943 ms |
4.2Answer quality (H2)
52 prompts spanning explanation, code, mathematics and reasoning, writing, advice and four-turn conversations were answered by each local model and by the cloud model, and judged pairwise (two judges, both orders: four verdicts per prompt). An answer is acceptable if it has no error that matters, follows the instructions, and is usable as is. Model choice decided most of the gap: 40% for Llama 3.1 8B, 91% for Gemma 4 26B, at the same local speed. The remaining gap to the cloud model is concentrated in hard prompts (86% vs 93%). The four verdicts agreed 99% of the time; as controls, an empty answer, "I don't know" and an off-topic answer were failed unanimously, and identical answers tied.
Data
| Model | Acceptable | Easy / hard | ≥ cloud model |
|---|---|---|---|
| Llama 3.1 8B (local) | 40% | 56% / 22% | 5% |
| Qwen 3.6 35B (local) | 78% | 78% / 78% | 27% |
| Gemma 4 26B (local, default) | 91% | 95% / 86% | 41% |
| Claude Sonnet 5 (cloud) | 97% | 100% / 93% | — |
4.3Context across a change of model (H3)
43 scripted conversations were written so that the final turn depends on something established earlier: a fact the user gave, a choice the assistant made, a standing instruction, a correction, code built over several turns, a running total, a system-prompt persona, or a long document. Each ran in six conditions and a negative control, three times (801 scored conversations; Table 2). Clients sent only each new message, so the history the model received came entirely from Junctra. Each final reply was graded against the case's checks, by code where possible and otherwise by the two blind judges, who were not told a switch had occurred. A switch is compared with the single-model condition whose model wrote the final reply, case by case.
| Condition | Kept | Δ vs control |
|---|---|---|
| Cloud model throughout (control) | 99% | — |
| Local model throughout (control) | 99% | — |
| Local, then cloud for the final turn | 99% | −0.3 [−1.2, +0.5] |
| Cloud, then local for the final turn | 99% | −0.3 [−1.9, +1.1] |
| Alternating every turn | 99% | +0.1 [−0.4, +0.6] |
| Local then cloud, with an earlier reply cut off and completed by another model | 100% | +0.5 [0.0, +1.5] |
| Final turn with no history (negative control) | 22% | −77.1 [−85.0, −68.9] |
No cost of switching was measurable. On every turn of all 801 conversations the model received the complete conversation, and the stored conversation matched what the client had seen. The negative control confirms the checks need the context: without history, final replies passed 2% of the context-dependent checks. The result is unchanged if only those checks are scored, or if a check counts only when both judges pass it. The judges agreed on 97% of verdicts, and disagreed no more often after a switch than without one. The few misses were the new model's own lapses with the full context in hand, and occurred about as often without a switch. One case showed a consistent pattern: after a user corrected a language from Python to JavaScript, the local model taking over from the cloud model returned to Python in 3 of 3 repetitions.
4.4Agent tasks across a change of model (H4)
Agents call tools: the model asks for a lookup or an action, the application runs it and returns the result, and the model continues. Ten multi-step tasks were run against a fixed, simulated environment: tracking an order through two chained lookups, a refund that depends on the return policy, a three-step directory search, booking a meeting from two calendars, restocking to target levels, a three-currency total, a document search, a two-city comparison, a tool that fails once and must be retried, and a task spanning two user messages. Each ran in five conditions, three times (150 runs; Table 3). After the first model call, a switch hands the task, with the tool calls made so far and their results, to a model from another provider. Everything was graded by code: the facts in the final answer, the actions taken and their arguments, the validity of every tool call, and calls repeated after they had already succeeded.
| Condition | Success | Δ vs control |
|---|---|---|
| Cloud model throughout (control) | 100% | — |
| Local model throughout (control) | 73% | — |
| Local starts, cloud finishes | 100% | 0 [0, 0] |
| Cloud starts, local finishes | 83% | +10 [0, +27] |
| Alternating every call | 93% | +13 [−7, +37] |
No cost of switching was measurable. In all 150 runs, every model call received the conversation with every tool call, its identifier, its arguments and its result unchanged, in both directions, and no provider rejected another's tool-call identifiers. All tool calls were well formed, and no run repeated a call that had already succeeded. The local model's score is set by its own limits: on its own it never retried a tool that failed once, booked an occupied slot, and miscalculated the currency total in two of three runs. When the cloud model made the first call, the local model finished the booking and currency tasks more often.
4.5Mid-reply takeover latency (H5)
On real requests the local model's stream was terminated partway through a reply, and another model continued it on the same connection. The wait is measured from the last token of the failed model to the first token of the continuation. Nine candidate models were screened on speed; the three fastest were given 100 takeovers each and Claude 300 (Table 4).
| Model taking over | n | Median wait | Visible seams | Decision |
|---|---|---|---|---|
| Gemma 4 31B | 100 | 805 ms | 1.0% | Default |
| Claude Sonnet 5 | 300 | 1,887 ms | 1.3% | Clean, slower |
| GPT-5.4 nano | 100 | 613 ms | 27% | Rejected |
| Ministral 8B | 100 | 493 ms | 45% | Rejected |
Junctra's own share of the wait for the default model was about 370 ms (target < 500 ms); the rest is the continuing model's time to first token. The fastest candidates were rejected on quality: a quarter to almost half of their takeovers showed at the join.
4.6Visible seams (H6)
A seam is repeated, missing or garbled text where one model's output ends and the next begins. Each join was shown to both judges with the join marked, and counted if either flagged it; text that was never cut off, marked at the same position, measures false flags. In 300 takeovers by Claude Sonnet 5, 4 had a visible seam: 1.3%, exact 95% upper bound 3.4%, under the 5% target. No never-cut-off control was flagged (0 of 200). Against hand labels, the grader caught 10 of 11 real flaws with one false flag in 439 clean joins. An earlier grader that judged whole texts flagged 6–10% of text that was never cut off and was replaced.
The default takeover model's 1 seam in 100 has an upper bound of 5.4%; on its own sample it is not yet certified under 5%.
4.7Caching, overhead and failure handling (H7–H9)
| Measure | Target | Result |
|---|---|---|
| Prompt read from cache on the next turn (4.5k-token conversation) | > 95% | 99% Claude; 93% GPT |
| First token on a cached local turn | — | 17× faster |
| Latency added to a normal request (p95) | < 25 ms | 4.0 ms |
| Concurrent streams before latency doubles | — | 400+ |
| Compute per response at the edge | — | 1–2.5 ms CPU |
| Broken streams seen by a client, 9 failure scenarios | 0 | 0 |
| Latency added by failover before the first byte | — | < 1 ms |
The failure scenarios cover a backend failing before and after its first byte, both backends down, rate limits, client aborts, truncated streams and concurrent turns on one conversation. A response that fails over before its first byte is byte-identical to one served directly.
5Discussion
Where hybrid serving loses. A takeover costs more than cloud-only for that one reply, because the continuing model is billed for the whole conversation. A repeatedly failing local model shifts traffic to the cloud until it recovers, which protects availability but not cost. Local answers remain acceptable somewhat less often than the cloud model's, mostly on hard prompts; routing decides on cost and availability, not on prompt difficulty. In this deployment the local half is one machine, and when it sleeps every request goes to the cloud.
Issues found by the experiments, and fixed. After a takeover, a routing rule kept conversations on the cloud model: affected sessions retained only 26% of the savings, 67% after the fix. After a cloud turn, long conversations were wrongly judged too large for the local model and stayed on the cloud; after the fix, all 12 affected conversations returned to the local model with every check passed. The first seam grader could not certify the 5% target and was replaced.
Threats to validity. One local and one main cloud model were tested; results may differ for other pairs. The context conversations are 2–5 turns, the agent tasks use at most five tool calls each, and neither includes images. One judge is from the same model family as one of the systems under test; the second judge, from another family, and the code-graded checks guard against this, but no human-labelled set exists yet for the context evaluation. Cost savings shown per turn in the live demo are estimated from delivered tokens; the figures in this report come from real cloud-only runs.
6Conclusion
Serving one conversation from a local and a cloud model cut cost by 97%, kept context and agent state across every kind of switch tested, and continued interrupted replies in under a second with a visible seam in about one takeover in seventy-five. The measured costs are a small quality gap on hard prompts and a higher price for the replies that need a takeover. Agent tasks, with their tool calls, survived a change of model as well. Next: a 300-takeover certification of the default takeover model.