{"id":15442566,"url":"https://github.com/primalmotion/simplai","last_synced_at":"2025-04-19T19:57:29.367Z","repository":{"id":204793000,"uuid":"712667918","full_name":"primalmotion/simplai","owner":"primalmotion","description":"A Go toolbox for building powerful LLM based application","archived":false,"fork":false,"pushed_at":"2024-01-01T22:01:11.000Z","size":11133,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T12:35:35.474Z","etag":null,"topics":["ai","golang","langchain","llm","simplai"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/primalmotion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-01T00:00:50.000Z","updated_at":"2024-06-08T04:44:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc3bd74d-9900-4abd-9c83-d0928cb42f92","html_url":"https://github.com/primalmotion/simplai","commit_stats":null,"previous_names":["primalmotion/simplai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primalmotion%2Fsimplai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primalmotion%2Fsimplai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primalmotion%2Fsimplai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primalmotion%2Fsimplai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/primalmotion","download_url":"https://codeload.github.com/primalmotion/simplai/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249787141,"owners_count":21325570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","golang","langchain","llm","simplai"],"created_at":"2024-10-01T19:28:37.164Z","updated_at":"2025-04-19T19:57:29.336Z","avatar_url":"https://github.com/primalmotion.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simplai\n\n\u003e THIS IS A WORK IN PROGRESS AND PREVIEW\n\nSimplAI (pronounced Simpl-Hey) is a library to build LLM based applications in\nGo. The goal of SimplAI is to only work with remote inference services like:\n\n- [VLLM](https://vllm.readthedocs.io/en/latest/)\n- [Ollama](https://ollama.ai/)\n\nThis avoids having to deal with the complexity of doing inference and such\nlocally in order to provide a sane interface that allows to build powerful LLM\napplications.\n\nThis is still a work in progress, and the API will change, but things are\nshaping up and soon unit testing will be added as the API stabilizes.\n\n## Concepts\n\nThe root concept of Simplai is to use chains of nodes. Each node deals with an\ninput and returns an output and an eventual error. This was inspired by\nLangchain (especially the part about the need to have a sane a simple\ninterface).\n\nRight now the repository contains several prompts, but those are bound to be\nmoved out of this repository, as it should only contain the basis to build\neverything else.\n\n## Try the example bot\n\nTo get started you must have a running instance of VLLM or Ollama, preferably\nrunning Mistral or Zephyr. While the connector for VLLM is using OpenAI style\nAPI, it has never been tested with anything OpenAI (and does not support\nauthentication yet anyways).\n\nThen run:\n\n    make build\n    cd cmd/simplai/\n    simplai \\\n      --engine openai \\\n      --api http://myserver:8000/v1 \\\n      --model HuggingFaceH4/zephyr-7b-beta \\\n      --searx-url https://some.searxinstance.org\n\nMore doc will be added over time. This is still really early in the dev, but the\nexamples already achieves very good results in our limited testing.\n\n## Components\n\nThe main components in the framework are the `node.Node`, `node.Subchain` and\n`node.Input`.\n\n### Node\n\n`Node` is the base object of the framework. A `Node` can be chained to another\n`Node`. Together they form a chain.\n\n    [prompt:genstory] -\u003e [llm:mistral] -\u003e [prompt:summarize] -\u003e [llm:zephyr]\n\nA chain can contain nested chains:\n\n    [prompt:search] -\u003e [ [prompt:summarize] -\u003e [llm] ] -\u003e [func:format] -\u003e [llm]\n\nA `Node` can be executed by calling its `Execute()` method. The execution is given a\n`context.Context` and an `Input`. It returns a string and an eventual error.\n\nThis output will then be fed to the next `Node` in the chain. This process continues\nuntil the execution reaches a node with no `Next()` Node. Then the output is\nunstacked and returned by the initial executed Node.\n\n### Subchain\n\nA `Subchain` is a Node that holds a separate chain of `[]Node`.\n\nIt can be considered as a single `Node`.\n\n    [node] -\u003e [[node]-\u003e[node]-\u003e[node]] -\u003e [node]\n\nIt can be useful to handle a separate set of `Input`, or `llm.Options` for\ninstance. `Subchains` can also be used in `Router` nodes, that will\nexecute a certain `Subchain` based on a condition.\n\n    [classify] -\u003e [llm] -\u003e [router] ?-\u003e [summarize] -\u003e[llm1]\n                                    ?-\u003e [search] -\u003e [llm2]\n                                    ?-\u003e [generate] -\u003e [llm3]\n\n`Subhain` embeds the `BaseNode` and can be used as any other node.\n\n### Input\n\nTODO\n\n## TODO\n\n- [x] base API\n- [x] chain system\n- [ ] better memory\n- [x] embedder\n- [x] store\n- [ ] unit tests\n- [x] flags for the main binary\n- [x] retry error back propagation\n- [x] doc strings\n- [ ] move some parts out of the repository (prompts)\n- [ ] declarative chain builder (from a yaml file or something like that)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimalmotion%2Fsimplai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprimalmotion%2Fsimplai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimalmotion%2Fsimplai/lists"}