You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-9Lines changed: 20 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -3,30 +3,28 @@
3
3
# NPC Toolkit
4
4
5
5
6
-
-`npcpy` is a python-based AI Agent framework designed to easily integrate Large Language Models and AI agents into python systems.
6
+
-`npcpy` is a python framework designed to easily integrate Large Language Models and AI agents into python systems.
7
7
- The NPC Shell `npcsh` provides a drop-in replacement for one's bash shell with natural language processing capabilities and a suite of built-in tools (macros) for tasks like voice control, image generation, and web searching. Through it's simple REPL system, one can interact with agents and orchestrate agent teams.
8
8
- With the `npc` CLI, users can use the same tools and macros of the NPC shell through a CLI and provides a quick and simple way to RESTfully serve an NPC Team to receive HTTP requests.
9
9
- The NPC Toolkit integrates with local and enterprise LLM providers through its LiteLLM integration, allowing users to run inference from Ollama, LMStudio, OpenAI, Anthropic, Gemini, and Deepseek, making it a versatile tool for both simple commands and sophisticated AI-driven tasks. All agentic capabilities are built and tested using small local models (like `llama3.2`) to ensure the agentic capabilities function even at the edge of computing.
10
10
11
+
11
12
Read the docs at [npcsh.readthedocs.io](https://npcsh.readthedocs.io/en/latest/)
12
13
13
14
There is a graphical user interface that makes use of the NPC Toolkit through the NPC Studio. See the open source code for NPC Studio [here](https://github.com/). Download the executables (soon) at [our website](https://www.npcworldwi.de/npc-studio).
14
15
15
16
Interested to stay in the loop and to hear the latest and greatest about `npcpy` and `npcsh` ? Be sure to sign up for the [newsletter](https://forms.gle/n1NzQmwjsV4xv1B2A)!
16
17
17
-
Build with sibiji the spider who will help you weave your agent web!
18
18
19
-
<palign="center">
20
-
<imgsrc="https://raw.githubusercontent.com/cagostino/npcsh/main/npcpy/npcsh.png"alt="npcsh logo with sibiji the spider">
21
-
</p>
19
+
22
20
23
21
24
22
## Star History
25
23
26
24
[](https://star-history.com/#cagostino/npcsh&Date)
27
25
28
26
## TLDR Cheat Sheet for NPC shell and cli
29
-
Below is a cheat sheet that shows how to use the NPC Toolkit's macro commands in both the shell and the CLI. For the `npcsh`` commands to work, one must activate `npcsh` by typing it in a shell.
27
+
The NPC shell and cli let users iterate and experiiment with AI in a natural way. Below is a cheat sheet that shows how to use the NPC Toolkit's macro commands in both the shell and the CLI. For the `npcsh` commands to work, one must activate `npcsh` by typing it in a shell.
30
28
31
29
| Task | npc CLI | npcsh |
32
30
|----------|----------|----------|
@@ -37,17 +35,24 @@ Below is a cheat sheet that shows how to use the NPC Toolkit's macro commands in
37
35
| Enter a chat with an NPC (NPC needs to be compiled first) | npc chat -n npc_name | /spool npc=<npc_name> |
| Get a sample LLM response | npc sample 'prompt' | /sample prompt for llm |
40
-
| Search for a term in the npcsh_db only in conversations with a specific npc | npc rag -n 'npc_name' -f 'filename' -q 'query' | /rag -n 'npc_name' -f 'filename' -q 'query' |
41
38
| Search the web | npc search -q "cal golden bears football schedule" -sp perplexity | /search -p perplexity 'cal bears football schedule' |
42
39
| Serve an NPC team | npc serve --port 5337 --cors='http://localhost:5137/'| /serve --port 5337 --cors='http://localhost:5137/'|
When beginning, `npcsh` initializes a set of agents that you can use and tweak as you go. Our mascot agent is sibiji the spider and he will help you weave your agent web!
45
+
46
+
<palign="center">
47
+
<imgsrc="https://raw.githubusercontent.com/cagostino/npcsh/main/npcpy/npcsh.png"alt="npcsh logo with sibiji the spider">
48
+
</p>
49
+
50
+
51
+
47
52
## Python Examples
48
53
Integrate `npcpy` into your Python projects for additional flexibility. Below are a few examples of how to use the library programmatically.
49
54
50
-
### Example 1: using npcsh's get_llm_response and get_stream
55
+
### Example 1: using npcpy's get_llm_response and get_stream
51
56
52
57
```python
53
58
from npcpy.llm_funcs import get_llm_response
@@ -93,8 +98,14 @@ response = get_llm_response("What is the capital of France? Respond with a json
93
98
94
99
#stream responses
95
100
96
-
response = get_stream("What is the capital of France? Respond with a json object containing 'capital' as the key and the capital as the value.", )
101
+
#deepseek
102
+
response = get_stream("What is the moon in the summer in the rain?", model='deepseek-chat', provider='deepseek')
103
+
104
+
#gemini
105
+
response = get_stream("What is the moon in the summer in the rain?", model='gemini-2.0-flash-lite', provider='gemini')
97
106
107
+
#hugginface model cards
108
+
response = get_stream("What is the moon in the summer in the rain?", model='hf.co/caug37/TinyTim', provider='ollama')
0 commit comments