#Exporting Directory from LLM output

1 messages · Page 1 of 1 (latest)

scenic ibex
#

I am doing some experiments with LLM on Dagger (local Docker model).

I want to export the result into a Directory type, using export in terminal.
I struggled a lot and I found out the issue was quite funny, let's say.

Here is the code

func (m *BaseAiAgent) GoAdvancedProgram(
    assignment string,
) *dagger.Directory {
    environment := dag.Env().
        WithStringInput("assignment", assignment, "the assignment to complete").
        WithContainerInput(
            "builder",
            dag.Container().From("golang").WithWorkdir("/app"),
            "a container to use for building Go code").
        WithDirectoryOutput("completed", "the completed assignment in the Golang container")

    prompt := dag.CurrentModule().
        Source().
        File("prompts/create_go_app.md")

    work := dag.LLM().
        WithEnv(environment).
        WithPromptFile(prompt)

    return work.
        Env().
        Output("completed").
        AsDirectory()

This code does not work, it fails in the export step

However fix was quite simple, basically exporting the directory from the container output.
Is there something I did not fully get from the doc?

func (m *BaseAiAgent) GoAdvancedProgram(
    assignment string,
) *dagger.Directory {
    environment := dag.Env().
        WithStringInput("assignment", assignment, "the assignment to complete").
        WithContainerInput(
            "builder",
            dag.Container().From("golang").WithWorkdir("/app"),
            "a container to use for building Go code").
        WithContainerOutput("completed", "the completed assignment in the Golang container")

    prompt := dag.CurrentModule().
        Source().
        File("prompts/create_go_app.md")

    work := dag.LLM().
        WithEnv(environment).
        WithPromptFile(prompt)

    return work.
        Env().
        Output("completed").
        AsContainer().Directory("/app")
lost schooner
#

I'm running on v0.19.7 fwiw

sage chasm
#

It could definitely depend on the model if you're using local models. If the first didn't work but the second did, it looks like the model didn't understand how to get a directory from a container on its own, so setting a container output was easier

scenic ibex
#

Thanks, at least it is supposed to work either way. I agree can be a limitation of the model itself, mine is : ai/gpt-oss-safeguard:20B

and it repeatedly outputs: "tool call 'Save' failed"

sage chasm
#

interesting, I haven't run the gpt-oss models in a bit, but we do run evals on our tool scheme against the big models. Its possible things break down a bit on the smaller models. I wonder if we're in a good spot to add a gpt-oss or qwen-coder model to our evals @bleak creek

scenic ibex
#

@sage chasm I am specifically interested in testing on local models to check what local LLMs is really capable to do, compared to priced services. That is why most of my tests are in that direction...

bleak creek
sage chasm