Change env vars to be more meaningful

This commit is contained in:
Ettore Di Giacinto
2025-03-05 22:19:07 +01:00
parent 127c76d006
commit 7492a3ab3b
6 changed files with 143 additions and 22 deletions

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023-2025 Ettore Di Giacinto (mudler@localai.io)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

122
README.md
View File

@@ -1,28 +1,110 @@
<p align="center">
<img src="https://github.com/user-attachments/assets/304ad402-5ddc-441b-a4b9-55ff9eec72be" alt="LocalAgent Logo" width="200"/>
</p>
![b644008916041](https://github.com/user-attachments/assets/304ad402-5ddc-441b-a4b9-55ff9eec72be)
<div align="center">
[![Go Report Card](https://goreportcard.com/badge/github.com/mudler/LocalAgent)](https://goreportcard.com/report/github.com/mudler/LocalAgent)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![GitHub stars](https://img.shields.io/github/stars/mudler/LocalAgent)](https://github.com/mudler/LocalAgent/stargazers)
[![GitHub issues](https://img.shields.io/github/issues/mudler/LocalAgent)](https://github.com/mudler/LocalAgent/issues)
</div>
**LocalAgent** is an AI Agent platform with the aim to runs 100% locally on your machine. Designed for privacy, efficiency, and flexibility, LocalAgent allows you to build, deploy, and interact with AI agents without sending your data to external services.
Check also:
## Features
- **100% Local Execution**: All processing happens on your own hardware - no data leaves your machine
- **Multiple Model Support**: Compatible with various local LLM formats (GGUF, GGML, etc.)
- **Extensible Architecture**: Build custom agents with specialized capabilities
- **Web-based GUI**: User-friendly interface for easy interaction with your agents
- **RESTful API**: Comprehensive API for developers to integrate LocalAgent into their applications
- **Works well locally!**: It is well tested and meant to work with [LocalAI](https://github.com/mudler/LocalAI)
- **Cross-platform**: Works on Linux, macOS, and Windows
LocalAgent is part of a set of open source tools aimed to streamline AI usage locally, see also its sister projects:
- [LocalAI](https://github.com/mudler/LocalAI)
- [LocalRAG](https://github.com/mudler/LocalRAG)
## Connectors
## Installation
### Github (issues)
### Prerequisites
Create an user and a PAT token:
For building from source:
- Go 1.20 or later
- Git
### From Source
```bash
# Clone the repository
git clone https://github.com/mudler/LocalAgent.git
cd LocalAgent
# Build the application
go build -o localagent
# Run LocalAgent
./localagent
```
### Using Docker containers
```bash
docker run -ti -p 3000:3000 -v quay.io/mudler/localagent
```
### Pre-built Binaries
Download the pre-built binaries for your platform from the [Releases](https://github.com/mudler/LocalAgent/releases) page.
## Getting Started
After installation, you can start LocalAgent with default settings:
```bash
./localagent
```
This will start both the API server and the web interface. By default, the web interface is accessible at `http://localhost:3000`.
### Environment Variables
LocalAgent can be configured using the following environment variables:
| Variable | Description |
|-------------------------------|--------------------------------------------------|
| `LOCALAGENT_MODEL` | Specifies the test model to use |
| `LOCALAGENT_LLM_API_URL` | URL of the API server |
| `LOCALAGENT_API_KEY` | API key for authentication |
| `LOCALAGENT_TIMEOUT` | Timeout duration for requests |
| `LOCALAGENT_STATE_DIR` | Directory to store state information |
| `LOCALAGENT_LOCALRAG_URL` | LocalRAG URL |
| `LOCALAGENT_ENABLE_CONVERSATIONS_LOGGING`| Enable or disable logging of conversations |
## Documentation
### Connectors
LocalAgent can be connected to a wide range of services. Each service support a set of configuration, examples are provided below for every connector.
#### Github (issues)
Create an user and a PAT token, and associate to a repository:
```json
{
"token": "PAT_TOKEN",
"repository": "testrepo",
"owner": "ci-forks",
"botUserName": "localai-bot"
"repository": "repository-to-watch-issues",
"owner": "repository-owner",
"botUserName": "username"
}
```
### Discord
#### Discord
Follow the steps in: https://discordpy.readthedocs.io/en/stable/discord.html to create a discord bot.
@@ -35,7 +117,7 @@ The token of the bot is in the "Bot" tab. Also enable " Message Content Intent "
}
```
### Slack
#### Slack
See slack.yaml
@@ -52,7 +134,7 @@ In the UI, when configuring the connector:
}
```
### Telegram
#### Telegram
Ask a token to @botfather
@@ -61,3 +143,21 @@ In the UI, when configuring the connector:
```json
{ "token": "botfathertoken" }
```
### REST API
The LocalAgent API follows RESTful principles and uses JSON for request and response bodies.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
<p align="center">
Made with ❤️ by <a href="https://github.com/mudler">mudler</a>
</p>

View File

@@ -13,7 +13,7 @@ func TestAgent(t *testing.T) {
RunSpecs(t, "Agent test suite")
}
var testModel = os.Getenv("TEST_MODEL")
var testModel = os.Getenv("LOCALAGENT_MODEL")
var apiModel = os.Getenv("API_MODEL")
func init() {

View File

@@ -38,8 +38,8 @@ services:
ports:
- 8080:3000
environment:
- TEST_MODEL=marco-o1
- LOCALAGENT_MODEL=marco-o1
- EMBEDDING_MODEL=bert-embeddings
- API_URL=http://api:8080
- LOCALAGENT_LLM_API_URL=http://api:8080
volumes:
- ./data/:/pool

14
main.go
View File

@@ -10,13 +10,13 @@ import (
"github.com/mudler/LocalAgent/webui"
)
var testModel = os.Getenv("TEST_MODEL")
var apiURL = os.Getenv("API_URL")
var apiKey = os.Getenv("API_KEY")
var timeout = os.Getenv("TIMEOUT")
var stateDir = os.Getenv("STATE_DIR")
var localRAG = os.Getenv("LOCAL_RAG")
var withLogs = os.Getenv("ENABLE_CONVERSATIONS_LOGGING") == "true"
var testModel = os.Getenv("LOCALAGENT_MODEL")
var apiURL = os.Getenv("LOCALAGENT_LLM_API_URL")
var apiKey = os.Getenv("LOCALAGENT_API_KEY")
var timeout = os.Getenv("LOCALAGENT_TIMEOUT")
var stateDir = os.Getenv("LOCALAGENT_STATE_DIR")
var localRAG = os.Getenv("LOCALAGENT_LOCALRAG_URL")
var withLogs = os.Getenv("LOCALAGENT_ENABLE_CONVERSATIONS_LOGGING") == "true"
func init() {
if testModel == "" {

View File

@@ -22,7 +22,7 @@ var _ = Describe("GenImageAction", func() {
BeforeEach(func() {
ctx = context.Background()
apiKey := os.Getenv("OPENAI_API_KEY")
apiURL := os.Getenv("OPENAI_API_URL")
apiURL := os.Getenv("OPENAI_LOCALAGENT_API_URL")
testModel := os.Getenv("OPENAI_MODEL")
if apiURL == "" {
Skip("OPENAI_API_URL must be set")