Try out the Classifier Agent UI here: https://classifier-agent.onrender.com/ui/
Suggested Questions
- What is the HS-Code of Coconut Candy with rice paper wrapper?
- What is the HS-Code of gold necklace with a silver pendant?
Feel free to give more complex descriptions to test the agent's limit.
classifier_agent-2-2.mov
.env
LLAMA_PARSE_API_KEY=llx-xxx
GROQ_API_KEY=gsk_xxx
OPENAI_API_KEY=sk-proj-xxxFrom the project root, install dependencies and run the UI:
pip install -r requirements.txtTo run local model, install them:
ollama run llama3.1:8b-instruct-q8_0 # must install
ollama run llama3-groq-tool-use # optional
ollama run mistral:7b # optionalThe Knowledge base is prepared for LLM model llama3.1:8b-instruct-q8_0 and Embedding Model BAAI/bge-small-en-v1.5 (free from HuggingFace). Knowledge base is built on the file stcced2022.pdf
Therefore, the search tool in regulatory_server.py is always used with LLM model llama3.1:8b-instruct-q8_0. (More adjustment will be done in the future)
The file stcced2022.pdf is already parsed using LlamaParse and stored as docs.md
To build the index (takes 32 seconds):
python app/index_server.pyIf there is a need to parse the data again, run this. This script already included index building step. This may take up to 40 minutes.
python app/index_server_improved.pyRun the FastAPI server
uvicorn app.main:app --host 0.0.0.0 --port 8000-
NiceGUI Open http://localhost:8000/ui in your browser. The UI has a left sidebar with conversation list, a main area for input (or process/conversation view), and a plus button (top right) to start a new prompt.
-
Run agent alone and view CoT in NiceGUI
curl --location 'http://localhost:8000/agent' \
--header 'Content-Type: application/json' \
--data '{
"user_input": "What is the HS-Code of Personal Deodorant?",
"model": "llama-3.3-70b-versatile",
"host": "cloud groq"
}'Note: The model is llama-3.3-70b-versatile from Cloud Groq by default if no information is provided. Only the following models are supported right now.
[
("Cloud OpenAI", "gpt-4o"),
("Cloud Groq", "llama-3.3-70b-versatile"),
("Cloud Groq", "llama3.1:8b-instruct-q8_0"),
("Local", "llama3.1:8b-instruct-q8_0"),
("Local", "llama3-groq-tool-use"),
("Local", "mistral:7b"),
]This may take a long time to build. Can try Running on local machine
docker build -t agent-ui --no-cache .docker run -p 8888:8888 --name agent-ui agent-ui- NiceGUI UI
Access: http://localhost:8888/ui
| Model | Latency | accuracy | Token cost/permit |
|---|---|---|---|
| cloud openai gpt4o | 125s | 5700 token/$0.0108 | |
| cloud groq llama-3.3-70b-versatile | 110s | 27900 token/$0.00 | |
| local llama3.1:8b-instruct-q8_0 | 112s | 41000 token (local) | |
| local llama3-groq-tool-use | 117s | High | 13200 token (local) |
| local mistral:7b | Cannot call tools |
To access Chain of Thought, please access NiceGUI to view all current chains of thought.
vid_cot.mp4
- Ensure Accuracy of the agent in different models
- Latency is still higher than the required threshold
- Dockerfile run requires more testing, still not stable
- NiceGUI implementation by Cursor AI
