正在加载视频...

视频加载失败

One feature I got to implement in OpenCode 2.0 was allowing for HOT CONTEXT¹ without busting the cache. Here's me explaining how it works ↓ ¹ ⁿᵒᵗ ᵃ ᵗᵉʳᵐ

112,249 次观看 • 3 个月前 •via X (Twitter)

41 条评论

Kit Langton 的头像
Kit Langton3 个月前

obligatory @samwhoo link

zeb 的头像
zeb3 个月前

@opencode This is smart but also I'm distracted by this really nice looking demo ui

Kit Langton 的头像
Kit Langton3 个月前

@opencode 🥰 aw, thank ye zeb!

beginbot 🃏 的头像
beginbot 🃏3 个月前

@opencode wait HOT LOCAL CONTEXT??? in my AREA???

Alan Rice 的头像
Alan Rice3 个月前

@opencode crazy they hired the same narrator as effect institute

Rhys 的头像
Rhys3 个月前

@opencode great explanation

AP 的头像
AP3 个月前

@opencode your demos are always the best holy

Kit Langton 的头像
Kit Langton3 个月前

@opencode 😳 😍

Sam Rose 的头像
Sam Rose3 个月前

@opencode How did you evaluate that this way of updating context values doesn’t affect the quality of the LLM’s replies?

Anders Lie 的头像
Anders Lie3 个月前

@opencode pretty cool! though makes you wonder in what cases you might just want to intentionally change the prefix rather than append deltas, e.g. if you are on a provider with known low cache ttl, or if returning to a session after a long time

Kit Langton 的头像
Kit Langton3 个月前

@opencode Yeah! If we have that information about the provider/model we can squash everything back into the prompt. I’ll look into this :)

Marcelo Prado 的头像
Marcelo Prado3 个月前

@opencode We built something very similar for our own internal harness. Lovely representation though, will share with my team bc it makes understanding the concept a lot easier lol

Jason Cameron 的头像
Jason Cameron3 个月前

@opencode Very intuitive demo

Alade Yessoufou 的头像
Alade Yessoufou3 个月前

@opencode Nice UI is that openTUI ?

Gjermund Garaba 的头像
Gjermund Garaba22 天前

@opencode

Antoine 的头像
Antoine3 个月前

@thdxr @opencode I wish opencode app would make cache easier to understand in general. Like if messages hit or miss cache, why (ttl, change of system prompt). Also knowing how much requests cost at message level would be sooo good to self improve.

Aman 的头像
Aman3 个月前

I use a simpler version of this for my personal agent, I keep the system prompt stable, then inject dynamic context right before the latest user turn. That gives me cache hits up to that point. It also works well for reminders and temporary instructions, since the context is recent and the LLM is more likely to follow them. The tradeoff is that on the next turn, I pay again for the previous turn’s new content, but I think it’s a nice tradeoff for the simplicity and cache efficiency.

Amaan 的头像
Amaan3 个月前

@opencode very interesting

manavv 的头像
manavv2 个月前

@opencode very interesting. learned something new today

Austin 的头像
Austin3 个月前

@opencode Cc @gubatron

agusti 的头像
agusti3 个月前

@opencode I always thought prepending that at the end of the transcript would work

Prathmesh 的头像
Prathmesh3 个月前

@opencode 😮🔥

Nick Venturi 的头像
Nick Venturi3 个月前

@opencode im stealing the term hot context and using it in my next meeting 😂

ManiGupt 的头像
ManiGupt3 个月前

@thdxr @opencode Urgently add method in app to delete project. Stuck with a dead project path. Cant add new.

Kit Langton 的头像
Kit Langton3 个月前

@thdxr @opencode Sorry, could you elaborate?

ManiGupt 的头像
ManiGupt3 个月前

@thdxr @opencode Desktop app doesnt have a project delete button option. I changed project location, now even after app restart it is stuck with old path. I deleted config and session files, didnt work. I tried deleting project using oc server too. This issue is open on gh. Many people requested

Kit Langton 的头像
Kit Langton3 个月前

@thdxr @opencode Got it! I’ll pass this along to the desktop ppl

Gregor 的头像
Gregor3 个月前

@opencode When the hot context itself changes between turns, which parts of the cache do you actually recover on the next request?

Evan 的头像
Evan3 个月前

@opencode cool implementation. have you run evals on this? i wonder if there are losses from the prompt structure

MobaiLabs | 墨白实验室 的头像
MobaiLabs | 墨白实验室2 个月前

@opencode @grok 具体是如何实现的

Vishal Gupta 的头像
Vishal Gupta3 个月前

@opencode The cache invalidation boundary is the architecture decision most inference implementations never make explicit. Once you do, cost and latency stop being mysteries and become variables you can control.

Caleb Norton 的头像
Caleb Norton3 个月前

@opencode i prefer to let my contexts bust as they please, keeping the hot ones from doing it seems kinda discriminatory

Andrés Delfino 的头像
Andrés Delfino3 个月前

@opencode This works non-deterministically, right? You rely on the model understanding what you want to do with the "context" tags, or understanding that it should change the date when they see several "today is". Not bashing, just wanting to understand! Looks cool :)

Mason Veilleux 的头像
Mason Veilleux22 天前

@opencode Is it getting hot in here?

Vishal Gupta 的头像
Vishal Gupta3 个月前

@opencode Separating mutable context from cacheable structure is the right split. Most implementations just re-run everything. Isolating what changes from what doesn't — that's correct architecture.

ishak 的头像
ishak2 个月前

@opencode but what if the diff is large? doesn't keeping both the before and after versions bloat the context?

🔥 fire 的头像
🔥 fire2 个月前

@opencode does this piecemeal approach have any effect when handling models with mid-thread dynamic tool injection like k3? ( I presume not )

Yousef Amirghofran 的头像
Yousef Amirghofran3 个月前

@opencode Very nice!!

bukit 🇮🇩 🇵🇸 🔻 的头像
bukit 🇮🇩 🇵🇸 🔻3 个月前

@opencode Question modal need new flow.. submit -> keep planning or submit -> build.

robby - rbby.dev 的头像
robby - rbby.dev3 个月前

@opencode Is this a new gui?

Rick Blalock 的头像
Rick Blalock3 个月前

@opencode nice!

相关视频