$git clone https://github.com/offline-ai/cli> 【English|中文】 --- The AI agent script CLI for Programmable Prompt Engine.
| 1 | # Offline AI PPE CLI(WIP) |
| 2 | |
| 3 | > 【English|[中文](./README.cn.md)】 |
| 4 | --- |
| 5 | The AI agent script CLI for [Programmable Prompt Engine](https://github.com/offline-ai/ppe). |
| 6 | |
| 7 | [](https://oclif.io) |
| 8 | [](https://npmjs.org/package/@offline-ai/cli) |
| 9 | [](https://npmjs.org/package/@offline-ai/cli) |
| 10 | |
| 11 | Enjoying this project? Please star it! 🌟 |
| 12 | |
| 13 | **Features**: |
| 14 | |
| 15 | * Programmable Prompt Engineering (PPE) language is a simple and natural scripting language designed for handling prompt information. This language is used to develop various agents that can be reused, inherited, combined, or called. |
| 16 | * Achieve or approximate the performance of ChatGPT 4 with open-source LLMs of medium to small scale (35B-4B parameters). |
| 17 | * User-friendly for ai development and creation of intelligent applications... |
| 18 | * Low-code or even no-code solutions for rapid ai development... |
| 19 | * Flexible, adding custom instructions within scripts, and inter-script calls... |
| 20 | * The data is completely open to the script, and the input and output data, even the internal data, can be freely accessed in the script |
| 21 | * Powerful, enabling event transmission seamlessly between client and server with numerous utility functions... |
| 22 | * Secure, supporting encrypted execution and usage limits for scripts(TODO)... |
| 23 | * Enable the local deployment and execution of large language models (LLMs) such as LLaMA, Qwen, Gemma, Phi, GLM, Mistral, and more. |
| 24 | * The AI Agent Script follows the [Programmable Prompt Engine Specification](https://github.com/offline-ai/ppe). |
| 25 | * Visit the site for the detailed AI Agent script usage. |
| 26 | * [PPE Fixtures Unit Test](https://github.com/offline-ai/cli-plugin-cmd-test.js) |
| 27 | * Unit Test Fixture Demo: https://github.com/offline-ai/cli/tree/main/examples/split-text-paragraphs |
| 28 | * Smart caching of LLM large models and intelligent agent invocation results to accelerate execution and reduce token expenses. |
| 29 | * Support for Multi LLM Service Providers: |
| 30 | * (**Recommended**) Builtin local LLM provider(llama.cpp) as default to protect the security and privacy of the knowledge. |
| 31 | * Download GGUF model file first: `ai brain download hf://bartowski/Qwen_QwQ-32B-GGUF -q q4_0` |
| 32 | * Run with the default brain model file: `ai run example.ai.yaml` |
| 33 | * Run with specified the model file: `ai run example.ai.yaml -P local://bartowski-qwq-32b.Q4_0.gguf` |
| 34 | * OpenAI Compatible Service Provider: |
| 35 | * OpenAI: `ai run example.ai.yaml -P openai://chatgpt-4o-latest --apiKey “sk-XXX”` |
| 36 | * DeepSeek: `ai run example.ai.yaml -P openai://deepseek-chat -u https://api.deepseek.com/ --apiKey “sk-XXX”` |
| 37 | * Siliconflow: `ai run example.ai.yaml -P openai://Qwen/Qwen2.5-Coder-7B-Instruct -u https://api.siliconflow.cn/ --apiKey “sk-XXX”` |
| 38 | * Anthropic(Claude): `ai run example.ai.yaml -P openai://claude-3-7-sonnet-latest -u https://api.anthropic.com/v1/ --apiKey “sk-XXX”` |
| 39 | * [llama-cpp Server(llama-server) Provider](https://github.com/ggml-org/llama.cpp/tree/master/examples/server): `ai run example.ai.yaml -P llamacpp` |
| 40 | * llama-cpp Server does not support specifying model name, It is specified with the model parameter when llama-server is started. |
| 41 | * You can specify or arbitrarily switch *LLM model or provider* in the PPE script. |
| 42 | |
| 43 | ```yaml |
| 44 | --- |
| 45 | parameters: |
| 46 | model: openai://deepseek-chat |
| 47 | apiUrl: https://api.deepseek.com/ |
| 48 | apiKey: "sk-XXX" |
| 49 | --- |
| 50 | system: You are a helpful assistant. |
| 51 | user: "tell me a joke" |
| 52 | --- |
| 53 | assistant: "[[AI]]" |
| 54 | --- |
| 55 | assistant: "[[AI:model='local://bartowski-qwq-32b.Q4_0.gguf']]" |
| 56 | ``` |
| 57 | |
| 58 | * Builtin local LLM provider(llama.cpp) **Features**: |
| 59 | * By default, it automatically detects memory and GPU, and uses the best computing layer by default. It automatically allocates gpu - layers and context window size (it will adopt the largest possible value) to get the best performance from the hardware withou |