octowombat

octowombat

Trying first LLM example in LiveBook fails

I tried to run the first LLM example “Your first LLM agent” in LiveBook. Firstly I got a weird Setup block:

Mix.install([
  {{mix_dep:jido}},
  {{mix_dep:jido_ai}},
  {{mix_dep:req_llm}}
])

which I could easily sort out. I set my OpenAI API key as directed as a secret in LiveBook which the block reported true as expected. However when I tried to run the “Ask the Agent” block I get the following;

10:49:25.330 [warning] Jido.AI.Reasoning.ReAct using ephemeral token secret (no configured :react_token_secret); checkpoint tokens expire on VM restart

10:49:25.335 [error] Provider failed to build streaming request: %ReqLLM.Error.API.Request{reason: "Failed to build Anthropic stream request: %ReqLLM.Error.Invalid.Parameter{parameter: ":api_key option, config :req_llm, anthropic_api_key, or ANTHROPIC_API_KEY env var (.env via dotenvy)", splode: nil, bread_crumbs: 
, vars: 
, path: 
, stacktrace: #Splode.Stacktrace<>, class: :invalid}", status: nil, response_body: nil, request_body: nil, cause: nil, headers: nil, splode: nil, bread_crumbs: 
, vars: 
, path: 
, stacktrace: #Splode.Stacktrace<>, class: :api}

10:49:25.335 [error] Failed to start HTTP streaming: {:provider_build_failed, %ReqLLM.Error.API.Request{reason: "Failed to build Anthropic stream request: %ReqLLM.Error.Invalid.Parameter{parameter: ":api_key option, config :req_llm, anthropic_api_key, or ANTHROPIC_API_KEY env var (.env via dotenvy)", splode: nil, bread_crumbs: 
, vars: 
, path: 
, stacktrace: #Splode.Stacktrace<>, class: :invalid}", status: nil, response_body: nil, request_body: nil, cause: nil, headers: nil, splode: nil, bread_crumbs: 
, vars: 
, path: 
, stacktrace: #Splode.Stacktrace<>, class: :api}}

10:49:25.335 [error] Failed to start streaming: {:http_streaming_failed, {:provider_build_failed, %ReqLLM.Error.API.Request{reason: "Failed to build Anthropic stream request: %ReqLLM.Error.Invalid.Parameter{parameter: ":api_key option, config :req_llm, anthropic_api_key, or ANTHROPIC_API_KEY env var (.env via dotenvy)", splode: nil, bread_crumbs: 
, vars: 
, path: 
, stacktrace: #Splode.Stacktrace<>, class: :invalid}", status: nil, response_body: nil, request_body: nil, cause: nil, headers: nil, splode: nil, bread_crumbs: 
, vars: 
, path: 
, stacktrace: #Splode.Stacktrace<>, class: :api}}}
Greeting: {:error,
{:failed, :error,
{:http_streaming_failed,
{:provider_build_failed,
%ReqLLM.Error.API.Request{
reason: "Failed to build Anthropic stream request: %ReqLLM.Error.Invalid.Parameter{parameter: ":api_key option, config :req_llm, anthropic_api_key, or ANTHROPIC_API_KEY env var (.env via dotenvy)", splode: nil, bread_crumbs: 
, vars: 
, path: 
, stacktrace: #Splode.Stacktrace<>, class: :invalid}",
status: nil,
response_body: nil,
request_body: nil,
cause: nil,
headers: nil,
splode: nil,
bread_crumbs: 
,
vars: 
,
path: 
,
stacktrace: #Splode.Stacktrace<>,
class: :api
}}}}}

No idea why its using Claude/Anthropic? Apart from if I do the following in the LiveBook;

Jido.AI.model_aliases()

it returns

%{
  image: "openai:gpt-image-1",
  thinking: "anthropic:claude-sonnet-4-20250514",
  embedding: "openai:text-embedding-3-small",
  reasoning: "anthropic:claude-sonnet-4-20250514",
  planning: "anthropic:claude-sonnet-4-20250514",
  fast: "anthropic:claude-haiku-4-5",
  capable: "anthropic:claude-sonnet-4-20250514"
}

which shows :fast as configured to be "anthropic:claude-haiku-4-5"

What am I doing wrong?

Thanks in advance

Mike

First Post!

ken-kost

ken-kost

Anthropic is by default, you need to override your aliases:

config :jido_ai, :model_aliases,  
  fast: "openai:gpt-4o-mini",  
  reasoning: "openai:gpt-4o",  
  planning: "openai:gpt-4o",  
  capable: "openai:gpt-4o"

Most Liked

octowombat

octowombat

Appreciate the offer - thanks, I will certainly bear it in mind. I also will see if there is anything I can do to give back too.

ken-kost

ken-kost

You can make a PR for docs, add a line that would prevent your problem for someone else. :cowboy_hat_face:

code is never done and docs are its last frontier

octowombat

octowombat

Hey thanks! I was and still am excited to try out Jido after listening to you on various podcasts and been a long time Elixir fan/dev/architect (since 2015, and Erlang before that).

I was sure it was my stupidity but as I only used LiveBook a while back (and my intention is not LiveBook) I switched to a bare simple Elixir project to debug my mistake.

Great work and I’m glad you carried on with it after you did a retrospective look a while back.

Mike

Where Next?

Popular in Troubleshooting Top

bugnano
Hello everyone. I’m the author of GitHub - bugnano/wtransport-elixir: Elixir bindings for the WTransport WebTransport library · GitHub ,...
New
Lotoen
Hello, I am currently using Elixir 1.18.4 and OTP 27 with Linux Mint 22.3 - Cinnamon 64-bit as my operating system. I came across this er...
New
ChrisAmelia
Currently reading and experimenting through, which is in 1.6 Chapter 7: Sign up | Phoenix Tutorial (Phoenix 1.6) | Softcover.io In regar...
New
hyperoceanic
Having read the book, I’m keen to explore Ash a bit more, but I’m falling at the first hurdle - the creation of a new project. Here’s my...
New
ktayah
Environment Oban Pro: 1.7.6 Oban: 2.22.1 Issue When a sub-workflow built with Workflow.put_context/2 is attached to a parent via ...
New
hakarabakara1
I have three modules, a Business which is associated Tags and Categories though join tables business_tags and business_categories. I inte...
New
lunipaws
while setting up my development enviroment I encountered an issue that I just haven’t been able to resolve after running mix phx.gen.cer...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement