I am trying to deploy a langchain app to vertex ai. My local directory structure is
app
- aicore
- tools
-- tool.py ( sampletool -> import libai.<<>>)
myapp.py (import tools.tool..sampletool)
The standard example suggests either pypi requirements or extra_packages with local directory structure. My tool.py may have dependencies from another local built wheel. Tried using extrapackages as below, but the engine fails with 500 (libai.<<>> not found). I want to provide a full package at runtime. Any ideas how to something like this ? I do see the uploaded package in the bucket, but I don't understand the structure of the docker image being built.
remote_app = reasoning_engines.ReasoningEngine.create(
graph_app,
requirements=[
"google-cloud-aiplatform[langchain,reasoningengine]",
"cloudpickle==3.0.0",
"pydantic==2.7.4",
"langgraph",
"httpx",
],
display_name=" Reasoning Engine",
description=" Reasoning Engine that uses LangGraph",
extra_packages=['dist/libapi-0.1.0-py3-none-any.whl', 'dist/libai-0.1.0-py3-none-any.whl'],
)
Solved! Go to Solution.
Hi @ai_1994,
Welcome to Google Cloud Community!
Thank you for sharing your inputs on resolving the issue. I understand that it is important to be able to upload packages instead of directories in Vertex AI. I suggest submitting this as a feature request here, which will allow others facing the same issue to see how it was resolved. Additionally, this will give you visibility into the progress of your request, as it will be publicly accessible. Please note that I am unable to provide specific details or timelines at this time, but you can monitor the release notes for any updates or new features related to Vertex AI.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Took a while to debug. Hope it helps someone. Here is how its debugged.
- First, including additional packages is probably not possible. But in my case, I could upload the directories as given in the example notebook just by including extra_packages = ['./app'}
- Second, I could check if the directory is added correctly by downloading dependencies.tar.gz in the bucket used for initiating vertexai
- third, checked logs and found that `AttributeError: 'FieldInfo' object has no attribute 'field_title_generator'` message. on closely watching it, found that its some kind of pydantic error. Checked which version has field_title_generator and found that exist in 2.9.2 pydantic, but not in suggested 2.7.4 version per example notebook.
- Upgraded to 2.9.2 and also downgraded python to 3.11 (I was on 3.12) to make dev and deployment versions match.
This solved the issue. It is still helpful to be able to upload packages instead of directories. But hopefully google will add this in future.
It will also be helpful for gcp to provide access to the failed pods and provide some kind of UI, like original langgraph platform for complex implementations and traceability.
Hi @ai_1994,
Welcome to Google Cloud Community!
Thank you for sharing your inputs on resolving the issue. I understand that it is important to be able to upload packages instead of directories in Vertex AI. I suggest submitting this as a feature request here, which will allow others facing the same issue to see how it was resolved. Additionally, this will give you visibility into the progress of your request, as it will be publicly accessible. Please note that I am unable to provide specific details or timelines at this time, but you can monitor the release notes for any updates or new features related to Vertex AI.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.