GitHunt
AI

Aiden-Jeon/agent-from-scratch

agent-from-scratch

How to start

Google Colaboratory

Order Name URL
1 Stop Open In Colab
2 StructuredOutput Open In Colab
3 BindTools Open In Colab
4 Agents Open In Colab

Local Setup

  1. Copy the environment template file to your own.
    cp env.template notebooks/.env
  2. Give your api key to the env file
    OPENAI_API_KEY=<YOUR-OPENAI-API-KEY>
    HF_TOKEN=<YOUR-HUGGINGFACE-API-KEY>
  3. Install packages
    pip install -r requirements.txt

Customization

For the huggingface model, I have test with huggingface/meta-llama/Llama-3.3-70B-Instruct, but this model require to pay.
So i have changed it to smaller model huggingface/microsoft/Phi-3.5-mini-instruct which is free to use.

If you want to test other models you can easily use like this:

hug_llm = ChatLiteLLM(
    model="huggingface/<REPO-NAME>/<MODEL-NAME>",
    temperature=0.2,
)
messages = [HumanMessage(content="what model are you")]
hug_llm.invoke(messages).pretty_print()

Contributors

Created December 2, 2024
Updated December 26, 2024
Aiden-Jeon/agent-from-scratch | GitHunt