Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in running example agents hello.py with together.ai backend. #156

Open
2 tasks
sameehj opened this issue Jan 20, 2025 · 1 comment
Open
2 tasks

Error in running example agents hello.py with together.ai backend. #156

sameehj opened this issue Jan 20, 2025 · 1 comment

Comments

@sameehj
Copy link

sameehj commented Jan 20, 2025

System Info

  • Intel Mac 2019
  • Conda
  • latest llama-stack / llama-stack model from repo with togther.ai
  • llama-stack-apps latest from repo

Information

  • The official example scripts
  • My own modified scripts

🐛 Describe the bug

I try to run the examples and it doesn't work even though api is functional.

might be caused by this:
meta-llama/llama-stack-client-python#92

Error logs

(stack-app-env) user@MonkeyPro llama-stack-apps % python -m examples.agents.hello localhost 5001
Traceback (most recent call last):
File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/user/local/llama-stack-apps/examples/agents/hello.py", line 95, in
fire.Fire(main)
File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/site-packages/fire/core.py", line 135, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/site-packages/fire/core.py", line 468, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/site-packages/fire/core.py", line 684, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/Users/user/local/llama-stack-apps/examples/agents/hello.py", line 30, in main
available_shields = [shield.identifier for shield in client.shields.list()]
File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/site-packages/llama_stack_client/resources/shields.py", line 114, in list
return self._get(
File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/site-packages/llama_stack_client/_base_client.py", line 1209, in get
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/site-packages/llama_stack_client/_base_client.py", line 955, in request
return self._request(
File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/site-packages/llama_stack_client/_base_client.py", line 1058, in _request
raise self._make_status_error_from_response(err.response) from None
llama_stack_client.NotFoundError: Error code: 404 - {'detail': 'Not Found'}

Expected behavior

The agents hello module run successfully.

NOTE: when I run the following, I get a successful response from the llama-stack:

(stack-app-env) user@MonkeyPro llama-stack % curl http://localhost:5001/v1/models

{"data":[{"identifier":"all-MiniLM-L6-v2","provider_resource_id":"all-MiniLM-L6-v2","provider_id":"sentence-transformers","type":"model","metadata":{"embedding_dimension":384},"model_type":"embedding"},{"identifier":"meta-llama/Llama-3.1-405B-Instruct-FP8","provider_resource_id":"meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo","provider_id":"together","type":"model","metadata":{},"model_type":"llm"},{"identifier":"meta-llama/Llama-3.1-70B-Instruct","provider_resource_id":"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo","provider_id":"together","type":"model","metadata":{},"model_type":"llm"},{"identifier":"meta-llama/Llama-3.1-8B-Instruct","provider_resource_id":"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo","provider_id":"together","type":"model","metadata":{},"model_type":"llm"},{"identifier":"meta-llama/Llama-3.2-11B-Vision-Instruct","provider_resource_id":"meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo","provider_id":"together","type":"model","metadata":{},"model_type":"llm"},{"identifier":"meta-llama/Llama-3.2-3B-Instruct","provider_resource_id":"meta-llama/Llama-3.2-3B-Instruct-Turbo","provider_id":"together","type":"model","metadata":{},"model_type":"llm"},{"identifier":"meta-llama/Llama-3.2-90B-Vision-Instruct","provider_resource_id":"meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo","provider_id":"together","type":"model","metadata":{},"model_type":"llm"},{"identifier":"meta-llama/Llama-3.3-70B-Instruct","provider_resource_id":"meta-llama/Llama-3.3-70B-Instruct-Turbo","provider_id":"together","type":"model","metadata":{},"model_type":"llm"},{"identifier":"meta-llama/Llama-Guard-3-11B-Vision","provider_resource_id":"meta-llama/Llama-Guard-3-11B-Vision-Turbo","provider_id":"together","type":"model","metadata":{},"model_type":"llm"},{"identifier":"meta-llama/Llama-Guard-3-8B","provider_resource_id":"meta-llama/Meta-Llama-Guard-3-8B","provider_id":"together","type":"model","metadata":{},"model_type":"llm"}]}%

@sameehj
Copy link
Author

sameehj commented Jan 21, 2025

The error was changed after I uninstalled the llama-stack-client python package (pip uninstall llama-stack-client)
and then installing the latest from the repo
see full details here: meta-llama/llama-stack-client-python#92

now the error is:
(stack-app-env) user@MonkeyPro llama-stack-apps % python -m examples.agents.hello localhost 5001 Available shields found: ['meta-llama/Llama-Guard-3-8B'] Using model: meta-llama/Llama-3.1-405B-Instruct-FP8 Traceback (most recent call last): File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/Users/user/local/llama-stack-apps/examples/agents/hello.py", line 95, in <module> fire.Fire(main) File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/site-packages/fire/core.py", line 135, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/site-packages/fire/core.py", line 468, in _Fire component, remaining_args = _CallAndUpdateTrace( File "/opt/anaconda3/envs/stack-app-env/lib/python3.10/site-packages/fire/core.py", line 684, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "/Users/user/local/llama-stack-apps/examples/agents/hello.py", line 71, in main agent = Agent(client, agent_config) File "/Users/user/local/llama-stack-client-python/src/llama_stack_client/lib/agents/agent.py", line 27, in __init__ self.agent_id = self._create_agent(agent_config) File "/Users/user/local/llama-stack-client-python/src/llama_stack_client/lib/agents/agent.py", line 33, in _create_agent agentic_system_create_response = self.client.agents.create( File "/Users/user/local/llama-stack-client-python/src/llama_stack_client/resources/agents/agents.py", line 117, in create return self._post( File "/Users/user/local/llama-stack-client-python/src/llama_stack_client/_base_client.py", line 1266, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) File "/Users/user/local/llama-stack-client-python/src/llama_stack_client/_base_client.py", line 958, in request return self._request( File "/Users/user/local/llama-stack-client-python/src/llama_stack_client/_base_client.py", line 1061, in _request raise self._make_status_error_from_response(err.response) from None llama_stack_client.BadRequestError: Error code: 400 - {'error': {'detail': {'errors': [{'loc': ['body', 'agent_config', 'sampling_params', 'strategy'], 'msg': 'Input should be a valid dictionary or object to extract fields from', 'type': 'model_attributes_type'}]}}}

@sameehj sameehj closed this as completed Jan 21, 2025
@sameehj sameehj reopened this Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant