#@Yves porting his agents to 0.18 ๐Ÿงต

1 messages ยท Page 1 of 1 (latest)

open dust
#

@versed shard @zealous bison @stuck plinth @regal cobalt we have some papercuts while porting Yves' module to 0.18

#

Looks like a bug when retrieving outputs

versed shard
#

anything needed for v0.18.1?

final veldt
#

So, this is my code:

env := dag.Env().
        WithAlpineWorkspaceInput("workspace", dag.AlpineWorkspace(source), "Alpine Environment with the source codebase mounted").
        WithAlpineWorkspaceOutput("result", "Workspace with the development tools installed")

    resEnv := dag.LLM().
        WithEnv(env).
        WithPromptFile(dag.CurrentModule().Source().File("qwen_dev_env.md")).
        Env()

And then, if I try to get the outputs through resEnv.Outputs(ctx) for instance (and to loop on them), the binding has no name and type void.
If I resEnv.Output("result") it says binding is nil

#

Not sure what I'm doing wrong
I can push the code if that's easier to look at

grizzled junco
#

@final veldt yes please

grizzled junco
#

@versed shard One thing i noticed is that there's a WithPrompt method on LLMSession but no WithPromptFile on LLMSession is that expected ?

#

the withprompt on llmsession does a syncvar before passing to lower-level llm.withprompt. WithPromptFile only exists on the lower level llm.WithPromptFile

versed shard
#

no reason it couldn't be added, that type is just to facilitate the REPL so things are added as-needed

grizzled junco
#

yes but regarding syncvar i'm not sure what's expected

#

also i'm vibe analysing here, didn't test my theory

versed shard
#

ah think i'm missing context - what's your end goal? is it related to the issue yves hit? that one seems like it's happening in code, not the repl?

grizzled junco
#

yes, debugging yves

#

i'm gonna confirm or infirm my theory soon

versed shard
#

you can do this now too: agent=$($agent | with-prompt-file ./foo)

grizzled junco
#

will just try WithPrompt(file.Contents()) instead of WithPromptFile(file)

grizzled junco
#

@versed shard small UX nit but i just got tricked by the shell completion when i didn't see there was a env | with-string-input because i would have had to scroll down to see it but didn't know there was more to see.

#

also why is there no with-string-output ?

versed shard
#

which is an issue some of them have - they just stop talking, instead of calling return to complete the task and return the outputs

final veldt
#

I'm using this one: eunomie/qwen2.5-coder-14b-instruct:q5_k_m

#

What should be returned by the model as what I'd like is the container updated, so not something returned by the model, no?

versed shard
# grizzled junco also why is there no with-string-output ?

currently only objects can be returned. strings and other types could be added, but we need to figure out where to draw the line - once you consider arrays for example there's an explosion of complexity. there's also potential danger in allowing it - for example LLMs are very bad at accurately reproducing text that you've given them, if there are escape sequences or whitespace or [...], but generating "from scratch"/"from prompt" is presumeably fine

grizzled junco
#

ok so for now i can do with-file-output insteaad of string

versed shard
# final veldt What should be returned by the model as what I'd like is the container updated, ...

when you declare outputs, the model has to call a return tool to fulfill them, like return {"result":"Workspace#1"} - it's transparent to you as a user, but the mechanism relies on the model to follow that instruction correctly, and some don't reliably follow it at the moment. it's likely that quen2.5 is among those, as even claude-3.5-sonnet was refusing to at times (though mysteriously seems to consistently use it now)

versed shard
grizzled junco
#

i'll be adding more env-related questions to the Environment API thread

#

i think i found the issue

#

Missing key field on Output binding

#

the thing is i'm unable to do a repro of Yves' yet, so i'm still just vibing here

final veldt
#

If you have the latest Docker Desktop, you can enable Docker Model Runner feature (in experimental), docker model pull eunomie/qwen2.5-coder-14b-instruct:q5_k_m and that should work out of the box with the .env in the repository
(but it means to run the model locally on your machine, and it only supports apple silicon)

grizzled junco
grizzled junco
#

My theory about withPrompt vs withPromptFile didn't hold, withPromptFile worked in my small repro attempt, so right now i'm just hoping my fix makes it work for you @final veldt . Sorry I can't pull the model and test it right now.

Are you able to build dagger main ? If so let us know if you still have the issue.

final veldt
#

I just tried, and it's not better, sadly ๐Ÿ˜•

#

I'm trying with a bigger model (gpt) just to see if that's better

grizzled junco
#

ok, then you may still try my stupid theory: replace WithPromptFile with WithPrompt

#

the only difference in the codebase is a suspicious function called syncVarsToLLM

versed shard
#

@final veldt do you have any Cloud traces I can look at? that would surface whether it's the return-not-being-called issue

#

(you could also see that locally but it may be hard to see what's not showing up but should :P)

final veldt
#

That works ๐ŸŽ‰

#
  1. Returns the modified development environment workspace.
  • Always return the modified development environment workspace
#

At least with main, I'll try now with 0.18.1

#

Sorry, that was a prompt issue, but thanks a lot for your ideas and ๐Ÿ‘€

versed shard
#

will test locally with the same model

final veldt
#

working on 0.18.1 too ๐ŸŽ‰
I can demo that tomorrow then ๐Ÿ™‚

#

Now I have an other demo that didn't worked, but I'll see if I can fix it

grizzled junco
#

I don't have access to the traces, what was the issue ?

grizzled junco
#

yeah it's a bit annoying to have to handhold the llm and that it can't figure it out from the provided env keys' description.

final veldt
#

Is that possible to use a model with the new env, with inputs but no outputs? Like I want the LLM to summarize some stuff and get back with the response, the lastReply should be enough, right?

versed shard
#

i'm making progress getting qwen2.5-coder:14b to call return but now it's calling it too eagerly lol

final veldt
#

Well, I started to use this kind of models while trying to have it generate code.
And when you run locally, there's a lot of bad surprises, models not able to call tools, able but not calling them, etc. And even with two sizes (like between the 14b and the 7b) differences can be huge.

#

So the smaller the model, the more specific you want it

versed shard
#

๐Ÿง‘ ๐Ÿ’ฌ Research and record a finding three times. Don't return until you have three findings.
๐Ÿค– ๐Ÿ› ๏ธ selectTestspace {"id":"Testspace#1"}
๐Ÿช™ Tokens Used: 583 in => 29 out
๐Ÿ› ๏ธ ๐Ÿ’ฌ {"selected":"Testspace#1"}
๐Ÿค– ๐Ÿ› ๏ธ Testspace_research {}
๐Ÿช™ Tokens Used: 708 in => 18 out
๐Ÿ› ๏ธ ๐Ÿ’ฌ {"result":"How interesting! The current time is 2025-04-01 21:25:34.913142257 +0000 UTC m=+0.089612706."}
๐Ÿค– ๐Ÿ› ๏ธ Testspace_withFinding {"finding":"The current time is 2025-04-01 21:25:34.913142257 +0000 UTC m=+0.089612706."}
๐Ÿช™ Tokens Used: 788 in => 73 out
๐Ÿ› ๏ธ ๐Ÿ’ฌ {"previous":"Testspace#1","selected":"Testspace#2"}
๐Ÿค– ๐Ÿ› ๏ธ return {"out":"Testspace#2"}
๐Ÿช™ Tokens Used: 821 in => 31 out
๐Ÿ› ๏ธ ๐Ÿ’ฌ ok
FrogeAngry

versed shard
final veldt
#

This is the quantization. 5 is a sweet spot, not as exact as a full model, but good. q8 is almost true. <q4 is lighter, but less precise. And k_m is optimized for metal (apple) if I'm right