Snapshot của sigoden/llm-functions: 786★ · Shell · AI Tools. Easily create LLM tools and agents using plain Bash/JavaScript/Python functions.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
This project empowers you to effortlessly build powerful LLM tools and agents using familiar languages like Bash, JavaScript, and Python.
Forget complex integrations, harness the power of function calling to connect your LLMs directly to custom code and unlock a world of possibilities. Execute system commands, process data, interact with APIs – the only limit is your imagination.
Tools Showcase
Agents showcase
Prerequisites
Make sure you have the following tools installed:
argc: A bash command-line framework and command runner
jq: A JSON processor
Getting Started with AIChat
Currently, AIChat is the only CLI tool that supports llm-functions. We look forward to more tools supporting llm-functions.
1. Clone the repository
git clone https://github.com/sigoden/llm-functions
cd llm-functions
2. Build tools and agents
I. Create a ./tools.txt file with each tool filename on a new line.
The web_search tool itself doesn't exist directly, Instead, you can choose from a variety of web search tools.
To use one as the web_search tool, follow these steps:
Choose a Tool: Available tools include:
web_search_cohere.sh
web_search_perplexity.sh
web_search_tavily.sh
web_search_vertexai.sh
Link Your Choice: Use the argc command to link your chosen tool as web_search. For example, to use web_search_perplexity.sh:
$ argc link-web-search web_search_perplexity.sh
This command creates a symbolic link, making web_search.sh point to your selected web_search_perplexity.sh tool.
Now there is a web_search.sh ready to be added to your ./tools.txt.
II. Create a ./agents.txt file with each agent name on a new line.
coder
todo
III. Build bin and functions.json
argc build
IV. Ensure that everything is ready (environment variables, Node/Python dependencies, mcp-bridge server)
argc check
3. Link LLM-functions and AIChat
AIChat expects LLM-functions to be placed in AIChat's functions_dir so that AIChat can use the tools and agents that LLM-functions provides.
You can symlink this repository directory to AIChat's functions_dir with:
ln -s "$(pwd)" "$(aichat --info | sed -n 's/^functions_dir\s\+//p')"
# OR
argc link-to-aichat
Alternatively, you can tell AIChat where the LLM-functions directory is by using an environment variable:
export AICHAT_FUNCTIONS_DIR="$(pwd)"
4. Start using the functions
Done! Now you can use the tools and agents with AIChat.
aichat --role %functions% what is the weather in Paris?
aichat --agent todo list all my todos
Writing Your Own Tools
Building tools for our platform is remarkably straightforward. You can leverage your existing programming knowledge, as tools are essentially just functions written in your preferred language.
LLM Functions automatically generates the JSON declarations for the tools based on comments. Refer to ./tools/demo_tool.{sh,js,py} for examples of how to use comments for autogeneration of declarations.
Bash
Create a new bashscript in the ./tools/ directory (.e.g. execute_command.sh).
#!/usr/bin/env bash
set -e
# @describe Execute the shell command.
# @option --command! The command to execute.
main() {
eval "$argc_command" >> "$LLM_OUTPUT"
}
eval "$(argc --argc-eval "$0" "$@")"
Javascript
Create a new javascript in the ./tools/ directory (.e.g. execute_js_code.js).
/**
* Execute the javascript code in node.js.
* @typedef {Object} Args
* @property {string} code - Javascript code to execute, such as `console.log("hello world")`
* @param {Args} args
*/
exports.run = function ({ code }) {
eval(code);
}
Python
Create a new python script in the ./tools/ directory (e.g. execute_py_code.py).
def run(code: str):
"""Execute the python code.
Args:
code: Python code to execute, such as `print("hello world")`
"""
exec(code)
Writing Your Own Agents
Agent = Prompt + Tools (Function Calling) + Documents (RAG), which is equivalent to OpenAI's GPTs.
The agent definition file (index.yaml) defines crucial aspects of your agent:
name: TestAgent
description: This is test agent
version: 0.1.0
instructions: You are a test ai agent to ...
conversation_starters:
- What can you do?
variables:
- name: foo
description: This is a foo
documents:
- local-file.txt
- local-dir/
- https://example.com/remote-file.txt
Refer to ./agents/demo for examples of how to implement a agent.
MCP (Model Context Protocol)
mcp/server: Let LLM-Functions tools/agents be used through the Model Context Protocol.
mcp/bridge: Let external MCP tools be used by LLM-Functions.
Documents
Tool Guide
Agent Guide
Argc Commands
License
The project is under the MIT License, Refer to the LICENSE file for detailed information.
sigoden/llm-functions thuộc nhóm AI Tools trên TopGit, cùng 10 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về sigoden/llm-functions ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/sigoden/llm-functions là nguồn chính thức.
sigoden/llm-functions có bao nhiêu sao?
sigoden/llm-functions có 786 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/sigoden/llm-functions. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
sigoden/llm-functions có phải mã nguồn mở không?
Có — sigoden/llm-functions phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/sigoden/llm-functions.
sigoden/llm-functions còn đang phát triển không?
Commit gần nhất trên sigoden/llm-functions là 1.4 năm trước (theo timestamp GitHub). Repo có 125 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
sigoden/llm-functions dùng license gì?
sigoden/llm-functions phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
sigoden/llm-functions là gì?
sigoden/llm-functions (sigoden/llm-functions) là dự án Shell trên GitHub. Theo mô tả gốc: Easily create LLM tools and agents using plain Bash/JavaScript/Python functions.
sigoden/llm-functions viết bằng ngôn ngữ gì?
sigoden/llm-functions chủ yếu viết bằng Shell. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc llm-functions có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về llm-functions.