Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 502b5cc

Browse filesBrowse files
Update README.md
1 parent 84c0920 commit 502b5cc
Copy full SHA for 502b5cc

File tree

Expand file treeCollapse file tree

1 file changed

+35
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+35
-0
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+35Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This package provides:
2020
- OpenAI-like API
2121
- [LangChain compatibility](https://python.langchain.com/docs/integrations/llms/llamacpp)
2222
- [LlamaIndex compatibility](https://docs.llamaindex.ai/en/stable/examples/llm/llama_2_llama_cpp.html)
23+
- Chat with kernel memory
2324
- OpenAI compatible web server
2425
- [Local Copilot replacement](https://llama-cpp-python.readthedocs.io/en/latest/server/#code-completion)
2526
- [Function Calling support](https://llama-cpp-python.readthedocs.io/en/latest/server/#function-calling)
@@ -704,6 +705,40 @@ docker run --rm -it -p 8000:8000 -v /path/to/models:/models -e MODEL=/models/lla
704705

705706
[Docker on termux (requires root)](https://gist.github.com/FreddieOliveira/efe850df7ff3951cb62d74bd770dce27) is currently the only known way to run this on phones, see [termux support issue](https://github.com/abetlen/llama-cpp-python/issues/389)
706707

708+
# SeKernel_for_LLM
709+
This is a Python module used to create memory in your chat applications.
710+
711+
## ⚙️ How to:
712+
- Clone the repo and import the module into your project. Ensure that it is in the project directory.
713+
- ```
714+
import kernel
715+
716+
# Initialize the kernel
717+
data = kernel
718+
719+
# Create a template
720+
data = [
721+
{"role": "system", "content": """You are an intelligent assistant. You always provide well-reasoned answers that are both correct and helpful."""},
722+
{"role": "user", "content": question},
723+
]
724+
725+
# Set messages parameter equal to data. Depending on your LLM API defintion, messages may be a different parameter, in this case it is messages, as defined in the OpenAI API definition.
726+
messages = data
727+
```
728+
See [OpenAI](https://platform.openai.com/docs/api-reference/chat/create) API reference for more.
729+
730+
```
731+
# You may then append any new content and/or messages to the kernel
732+
data.append(new_message)
733+
```
734+
## 📽️ Short Films
735+
See an example of using the SeKernel_for_LLM with 🦙 [LlamaCpp Python bindings](https://github.com/abetlen/llama-cpp-python)
736+
737+
https://github.com/user-attachments/assets/cb48e962-2cba-4672-b4e7-c0f77455bb74
738+
739+
740+
🍾 I hope this helps someone starting out. Happy prompting!!!
741+
707742
## Low-level API
708743

709744
[API Reference](https://llama-cpp-python.readthedocs.io/en/latest/api-reference/#low-level-api)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.