•  


GitHub - emirsahin1/llm-axe: A simple, intuitive toolkit for quickly implementing LLM powered applications.
Skip to content

A simple, intuitive toolkit for quickly implementing LLM powered applications.

License

Notifications You must be signed in to change notification settings

emirsahin1/llm-axe

Repository files navigation

llm-axe

PyPI - Version PyPI - Downloads Static Badge GitHub forks Hits

Static Badge

Goal

llm-axe is meant to be a flexible toolkit that provides simple abstractions for commonly used functions related to LLMs. It's not meant to intrude in your development workflow as other larger frameworks often do.

It has functions for automatic schema generation , pre-made agents with self-tracking chat history and fully customizable agents .

Have feedback/questions? Join the Discord

Installation

pip install llm-axe

Example Snippets

llm
 =
 OllamaChat
(
model
=
"llama3:instruct"
)
agent
 =
 Agent
(
llm
, 
custom_system_prompt
=
"Always respond with the word LLAMA, no matter what"
)
resp
 =
 agent
.
ask
(
"What is the meaning of life?"
)
print
(
resp
)

# Output

# LLAMA
  • Function Calling

??A function calling LLM can be created with just 3 lines of code :
??No need for premade schemas, templates, special prompts, or specialized functions.

prompt
 =
 "I have 500 coins, I just got 200 more. How many do I have?"


llm
 =
 OllamaChat
(
model
=
"llama3:instruct"
)
fc
 =
 FunctionCaller
(
llm
, [
get_time
, 
get_date
, 
get_location
, 
add
, 
multiply
])
result
 =
 fc
.
get_function
(
prompt
)
  • Online Agent
prompt
 =
 "Tell me a bit about this website:  https://toscrape.com/?"

llm
 =
 OllamaChat
(
model
=
"llama3:instruct"
)
searcher
 =
 OnlineAgent
(
llm
)
resp
 =
 searcher
.
search
(
prompt
)

#output: Based on information from the internet, it appears that https://toscrape.com/ is a website dedicated to web scraping.

# It provides a sandbox environment for beginners and developers to learn and validate their web scraping technologies...
  • PDF Reader
llm
 =
 OllamaChat
(
model
=
"llama3:instruct"
)
files
 =
 [
"../FileOne.pdf"
, 
"../FileTwo.pdf"
]
agent
 =
 PdfReader
(
llm
)
resp
 =
 agent
.
ask
(
"Summarize these documents for me"
, 
files
)
  • Data Extractor
llm
 =
 OllamaChat
(
model
=
"llama3:instruct"
)
info
 =
 read_pdf
(
"../Example.pdf"
)
de
 =
 DataExtractor
(
llm
, 
reply_as_json
=
True
)
resp
 =
 de
.
ask
(
info
, [
"name"
, 
"email"
, 
"phone"
, 
"address"
])

#output: {'Name': 'Frodo Baggins', 'Email': 'frodo@gmail.com', 'Phone': '555-555-5555', 'Address': 'Bag-End, Hobbiton, The Shire'}
  • Object Detector
llm
 =
 OllamaChat
(
model
=
"llava:7b"
)
detector
 =
 ObjectDetectorAgent
(
llm
, 
llm
)
resp
 =
 detector
.
detect
(
images
=
[
"../img2.jpg"
], 
objects
=
[
"sheep"
, 
"chicken"
, 
"cat"
, 
"dog"
])

#{

#  "objects": [

#    { "label": "Sheep", "location": "Field", "description": "White, black spots" },

#    { "label": "Dog", "location": "Barn", "description": "Brown, white spots" }

#  ]

#}

See more complete examples

How to setup llm-axe with your own LLM

Features

  • Local LLM internet access with Online Agent
  • PDF Document Reader Agent
  • Premade utility Agents for common tasks
  • Compatible with any LLM, local or externally hosted
  • Built-in support for Ollama

Important Notes

The results you get from the agents are highly dependent on the capability of your LLM. An inadequate LLM will not be able to provide results that are usable with llm-axe

Testing in development was done using llama3 8b:instruct 4 bit quant

About

A simple, intuitive toolkit for quickly implementing LLM powered applications.

Topics

Resources

License

Stars

Watchers

Forks

Languages

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본