# Building your own AI Agent but hitting my head on "ImportError: cannot import name 'LangSmithParams'"

**URL:** <https://community.crewai.com/t/building-your-own-ai-agent-but-hitting-my-head-on-importerror-cannot-import-name-langsmithparams/806>\
**Category:** CrewAI Community Support\
**Tags:** tools\_issues, agent\
**Created:** [October 15, 2024, 8:32am UTC](https://community.crewai.com/t/building-your-own-ai-agent-but-hitting-my-head-on-importerror-cannot-import-name-langsmithparams/806 "2024-10-15T08:32:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charles\_Mo](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@Charles\_Mo](https://community.crewai.com/u/Charles_Mo)\
**Post date:** [October 15, 2024, 8:32am UTC](https://community.crewai.com/t/building-your-own-ai-agent-but-hitting-my-head-on-importerror-cannot-import-name-langsmithparams/806/1 "2024-10-15T08:32:14Z")

</div>

HI All,

I am new to CrewAI, I have been using Lightening.ai as my IDE to start experimenting wit AI Agents.

I have been following Matthew Berman video, here’s the link to one I have been watching on [The right way to build AI Agents on CrewAI](https://youtu.be/iJjSjmZnNlI?si=gemkt3wwHd5ekom5)

Can you advise me maybe where I should start to build AI Agent examples, because I think the video although good, it might be missing out on many details.

My main issue is not understanding how to deal with this error:

ImportError: cannot import name ‘LangSmithParams’ from ‘langchain\_core.language\_models.chat\_models’ (/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/langchain\_core/language\_models/chat\_models.py)

---

<div class="post-metadata">

**Author:** ![Dabnis](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@Dabnis](https://community.crewai.com/u/Dabnis)\
**Post date:** [October 15, 2024, 9:07am UTC](https://community.crewai.com/t/building-your-own-ai-agent-but-hitting-my-head-on-importerror-cannot-import-name-langsmithparams/806/2 "2024-10-15T09:07:40Z")

</div>

Hi @Charles_Mo,  
One of the best places to start is the [Getting Started with CrewAI](https://docs.crewai.com/introduction).  
Reason: There are several LLM Agent frameworks and each has its own philosophy of how they ‘term’ structured, terminology, etc. If you have decided on CrewAI then the best place to start is at the ‘getting started’ section in that link above.

All LLM Agent frameworks have one common denominator: However they structure the user level, and whatever terms they use: TAsk; Agent, etc. Under the hood they all basically do the same thing:  
They create prompts and context from the definitions of: Task’s, Agents’, sometimes from memory to create a single text prompt that is fed into an LLM to perform a task. Yes Tasks & Agents are just named containers where text is collected from the user. Under the hood they have different ways of manipulating the text to form a prompt.

That’s the basics of all LLM Agent type systems.

So do the ‘getting started’ to learn how CrewAI does this.

We are all here to help you if needed.

Best of luck 🫰

Your issue: Have you installed the requirements?

N.B. I have noticed some discussions on this discord relating to issues with different versions of Python, may be worth a look. In the search box (top right) type in ‘python’ …

---

<div class="post-metadata">

**Author:** ![Charles\_Mo](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@Charles\_Mo](https://community.crewai.com/u/Charles_Mo)\
**Post date:** [October 17, 2024, 9:33pm UTC](https://community.crewai.com/t/building-your-own-ai-agent-but-hitting-my-head-on-importerror-cannot-import-name-langsmithparams/806/3 "2024-10-17T21:33:58Z")

</div>

This is great @Dabnis and thank you for taking the time to write this. I will keep this post alive with my progress, which I hope will help others.

---

<div class="post-metadata">

**Author:** ![Charles\_Mo](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@Charles\_Mo](https://community.crewai.com/u/Charles_Mo)\
**Post date:** [October 17, 2024, 10:12pm UTC](https://community.crewai.com/t/building-your-own-ai-agent-but-hitting-my-head-on-importerror-cannot-import-name-langsmithparams/806/4 "2024-10-17T22:12:10Z")

</div>

okay, I have finally followed the crewai tutorial to build your first ai crew, but I am getting a lot of “OpenAIError”.

I know why, but not sure how to fix. I am attempting to use Groq LLM, so I have define the API in the .env, but it is clear I need to ‘tell’ the code to use Groq API instead of OpenAI. However, it is not clear to me where I do this in the code files.

Maybe I should just pay OpenAI, but eventually I would like to use Llama LLM next. Help on this would be very grateful?

---

<div class="post-metadata">

**Author:** ![rokbenko](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/rokbenko/32/492_2.png) [@rokbenko](https://community.crewai.com/u/rokbenko)\
**Post date:** [October 18, 2024, 7:14am UTC](https://community.crewai.com/t/building-your-own-ai-agent-but-hitting-my-head-on-importerror-cannot-import-name-langsmithparams/806/5 "2024-10-18T07:14:17Z")

</div>

@Charles_Mo The trick is the `base_url` parameter. By setting it, you can use the OpenAI’s library with Groq.

The following code should work:

```auto
from crewai import Agent
from langchain_openai import OpenAI

my_llm = OpenAI(
    base_url="https://api.groq.com/openai/v1",
    api_key=os.environ.get("GROQ_API_KEY"),
)

my_agent = Agent(
    ...,
    llm=my_llm,
)

```

---

<div class="post-metadata">

**Author:** ![Charles\_Mo](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@Charles\_Mo](https://community.crewai.com/u/Charles_Mo)\
**Post date:** [October 18, 2024, 10:54am UTC](https://community.crewai.com/t/building-your-own-ai-agent-but-hitting-my-head-on-importerror-cannot-import-name-langsmithparams/806/6 "2024-10-18T10:54:31Z")

</div>

Awesome thanks @rokbenko . Sorry to ask you a follow up, have you tried connecting to llama, which I have installed locally on my Mac and it would be great to run a open source LLM which Llama has quite a few variants and it is free.

---

<div class="post-metadata">

**Author:** ![rokbenko](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/rokbenko/32/492_2.png) [@rokbenko](https://community.crewai.com/u/rokbenko)\
**Post date:** [October 18, 2024, 11:17am UTC](https://community.crewai.com/t/building-your-own-ai-agent-but-hitting-my-head-on-importerror-cannot-import-name-langsmithparams/806/7 "2024-10-18T11:17:45Z")

</div>

> [@Charles\_Mo](#):
>
> have you tried connecting to llama, which I have installed locally on my Mac and it would be great to run a open source LLM which Llama has quite a few variants and it is free

Yes, I’ve tried. I suppose you want to run one of the smaller Llama LLMs? Running these will result in poor(er) CrewAI performance. See this [GitHub thread](https://github.com/crewAIInc/crewAI/issues/103).

---

<div class="post-metadata">

**Author:** ![Dabnis](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@Dabnis](https://community.crewai.com/u/Dabnis)\
**Post date:** [October 18, 2024, 2:48pm UTC](https://community.crewai.com/t/building-your-own-ai-agent-but-hitting-my-head-on-importerror-cannot-import-name-langsmithparams/806/8 "2024-10-18T14:48:17Z")

</div>

FYI: I am running Llama 3.2 instruct in LM Studio and it performs ‘almost’ as good as GPT-4o-mini: Llama3.2 3B is only 3.42 Gb

 ![Screenshot 2024-10-18 154716](https://us1.discourse-cdn.com/flex025/uploads/crewai/original/1X/e73bff64a3c7ce06b8c1ddbd9f855f37014a5b32.png)

Yes I have twin 4090’s, but even when I set GPU offload to ‘0’ I still have a functioning LLM

 ![Screenshot 2024-10-18 155042](https://us1.discourse-cdn.com/flex025/uploads/crewai/original/1X/2a6228748d731c331c4b88aa1de13dc59d0f7d20.png)  
Note the GPU offload

If you have low memory issues, de-select ‘keep model in memory’.

 ![Screenshot 2024-10-18 155220](https://us1.discourse-cdn.com/flex025/uploads/crewai/original/1X/10adfa64678b574720db2d9e109e46ba4046dd7d.png)

Just had a ‘quick’ look at that github thread and they refer to models that are larger than Llama3.2-3b-instruct!

Worth a try!
