Skip to content

Commit

Permalink
Merge pull request #120 from MorpheusAIs/develop
Browse files Browse the repository at this point in the history
0.2.1 main
  • Loading branch information
LachsBagel authored Dec 10, 2024
2 parents 95b5b3b + cff90c4 commit cb80fb1
Show file tree
Hide file tree
Showing 178 changed files with 36,159 additions and 2,124 deletions.
43 changes: 43 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[flake8]
max-line-length = 100
max-complexity = 10
exclude =
.git,
__pycache__,
build,
dist,
*.egg-info,
venv,
.venv
extend-ignore =
# Black conflicts with E203 (whitespace before ':')
E203,
# Line break before binary operator (Black formats this way)
W503,
# Lambda assignments (used in routes)
E731,
# Bugbear errors that might cause recursion
B023,
# Ignore nested function definition
B006,
# Ignore missing docstring in public module/package/class/function/method
D100,
D101,
D104,
D102,
D103,
D105,
D106,
D107,

per-file-ignores =
# Allow unused imports in __init__.py
__init__.py: F401
# Allow longer lines in config files
config.py: E501

# Limit the plugins to avoid recursion issues
enable-extensions = B

# Increased recursion depth adjustment for bugbear
max-recursion-depth = 1000
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# .github/workflows/lint.yml
name: Lint

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Python linting dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black isort
pip install -r requirements.txt
- name: Run Python linters
run: |
black . --check
isort . --check-only
4 changes: 2 additions & 2 deletions .github/workflows/mor-agents-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
local model=\$1
local max_attempts=3
local attempt=1
while [ \$attempt -le \$max_attempts ]; do
echo -e "\${YELLOW}Pulling Ollama model \$model (Attempt \$attempt)...${NC}"
if ollama pull \$model; then
Expand All @@ -115,7 +115,7 @@ jobs:
sleep 5
attempt=\$((attempt + 1))
done
echo -e "\${RED}Failed to pull \$model after \$max_attempts attempts.${NC}"
return 1
}
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/mor-agents-build-mac-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,45 @@ on:
jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build with PyInstaller
run: |
pyinstaller --windowed --name="MORagents" --icon="images/moragents.icns" --osx-entitlements-file "build_assets/macOS/MORagents.entitlements" main.py
- name: Move .app to expected location
run: |
mv dist/MORagents.app build_assets/macOS/
- name: Install Packages app
run: |
wget http://s.sudre.free.fr/files/Packages_1211_dev.dmg
hdiutil attach Packages_1211_dev.dmg
sudo installer -pkg /Volumes/Packages\ 1.2.11/packages/Packages.pkg -target /
hdiutil detach /Volumes/Packages\ 1.2.11
- name: Create installer package
run: |
cd build_assets/macOS
/usr/local/bin/packagesbuild --verbose --project MorpheusPackagesSudre.pkgproj
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: MORagentsSetup-macOS
path: ./build_assets/macOS/MORAgentsInstaller.pkg
path: ./build_assets/macOS/MORAgentsInstaller.pkg
18 changes: 9 additions & 9 deletions .github/workflows/mor-agents-build-mac-intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,45 @@ on:
jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build with PyInstaller
run: |
pyinstaller --windowed --name="MORagents" --icon="images/moragents.icns" --osx-entitlements-file "build_assets/macOS/MORagents.entitlements" main.py
- name: Move .app to expected location
run: |
mv dist/MORagents.app build_assets/macOS/
- name: Install Packages app
run: |
wget http://s.sudre.free.fr/files/Packages_1211_dev.dmg
hdiutil attach Packages_1211_dev.dmg
sudo installer -pkg /Volumes/Packages\ 1.2.11/packages/Packages.pkg -target /
hdiutil detach /Volumes/Packages\ 1.2.11
- name: Create installer package
run: |
cd build_assets/macOS
/usr/local/bin/packagesbuild --verbose --project MorpheusPackagesSudreIntel.pkgproj
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: MORagentsSetup-macOS
path: ./build_assets/macOS/MORAgentsInstaller.pkg
path: ./build_assets/macOS/MORAgentsInstaller.pkg
2 changes: 1 addition & 1 deletion .github/workflows/mor-agents-build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/security_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ jobs:
run: bandit -r . -f custom
continue-on-error: true
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.20.0
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL'
scanners: 'vuln,secret,config'
- name: Upload Trivy scan results
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
sarif_file: 'trivy-results.sarif'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ resources/*
## installer
MORagentsWindowsInstaller
MORagentsWindowsInstaller.zip
build_assets/macOS/MORAgentsInstaller.pkg

## app
MORagents.app

## lint
.pytest_cache/
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-added-large-files
- id: detect-private-key
- id: check-merge-conflict

- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
language_version: python3.12

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
14 changes: 7 additions & 7 deletions AGENTABILITIES.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# MORagents
Welcome to the world of Web3 agents! If you're interested in building and using agents locally, this document will guide you through the principles and
Welcome to the world of Web3 agents! If you're interested in building and using agents locally, this document will guide you through the principles and
current projects underway.

### Principles:
1. **Agents cannot execute decisions**: Agents should not be given private keys or allowed to make transactions on their own. They can only construct transaction
1. **Agents cannot execute decisions**: Agents should not be given private keys or allowed to make transactions on their own. They can only construct transaction
payloads for a user's approval. This is due to the limitations of current LLMs in understanding complex transactions and the risk of [gaslighting](https://arxiv.org/abs/2311.04235).
2. **Local installation**: Agents should run on the user's laptop, typically with 8-16 GB of RAM. This allows for faster execution and better performance.
3. **No private keys**: Agents must not have access to private keys or be able to execute transactions independently. User's cryptographic approval is essential for any
3. **No private keys**: Agents must not have access to private keys or be able to execute transactions independently. User's cryptographic approval is essential for any
transaction.

### Current Projects:
1. **lachsbagel on Discord** - [this repo](https://github.com/MorpheusAIs/moragents):
1. **lachsbagel on Discord** - [this repo](https://github.com/MorpheusAIs/moragents):
1. Architecture
2. **IODmitri, SanatSharma, LachsBagel on GitHhub**
1. [HideNSeek](https://github.com/MorpheusAIs/HideNSeek): An algorithm for verifying and fingerprinting which model a compute provider is actually running
Expand All @@ -25,10 +25,10 @@ transaction.
4. CICD builds for Linux and macOS (apple and intel)
5. Vulnerability scanning of dependencies and code
4. GenLayer
1. (pending) [FeedBuzz](https://github.com/yeagerai/feedbuzz-contracts) - AI filtered logging system to surface user demand and failure modes for new functionality
1. (pending) [FeedBuzz](https://github.com/yeagerai/feedbuzz-contracts) - AI filtered logging system to surface user demand and failure modes for new functionality
5. **CliffordAttractor on Discord** - Following Assume 16GB+ RAM:
1. Developed a [price fetcher agent](submodules/moragents_dockers/agents/src/data_agent) using CoinGecko.
2. A [web interface](submodules/moragents_dockers/frontend) which is served by the local Docker installation and integrated with Rainbow, enabling the use of MetaMask, WalletConnect, and other
2. A [web interface](submodules/moragents_dockers/frontend) which is served by the local Docker installation and integrated with Rainbow, enabling the use of MetaMask, WalletConnect, and other
EVM-based wallets.
3. (NEEDS REFACTORING DUE TO 1INCH CHANGE) [Swap agent](submodules/moragents_dockers/agents/src/swap_agent) which can iteratively ask users to provide needed details for disambiguation.
4. [General-purpose agent](https://github.com/MorpheusAIs/moragents/pull/34) that can ingest arbitrary documents, such as PDFs, for basic document QA and text generation.
Expand Down Expand Up @@ -57,7 +57,7 @@ Pending Lumerin's work. Eventually Agent Builders will be able to permission-les


### How to Contribute:
- If you are working on an agent which can provide value through open models and relies on processing public data, please reach out to lachsbagel on Discord (link below)
- If you are working on an agent which can provide value through open models and relies on processing public data, please reach out to lachsbagel on Discord (link below)
- Otherwise, you are more than welcome to publish your agent to the registry when it goes live pending Lumerin's work and any other necessary pieces which come up to better ensure security and verifiability of models in non-local execution environments.
- If you are working on security and/or verifiability of models and the runtime, please reach out to LachsBagel on the Morpheus Discord.
- Currently looking at [Hyperbolic.xyz](https://hyperbolic.xyz) and [6079](https://docs.6079.ai/technology/6079-proof-of-inference-protocol). See more ecosystem members [here](https://mor.org/ecosystem).
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion DISCLAIMER.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This highly experimental chatbot is not intended for making important decisions, and its responses are generated based on incomplete data and algorithms that may evolve
This highly experimental chatbot is not intended for making important decisions, and its responses are generated based on incomplete data and algorithms that may evolve
rapidly. By using this chatbot, you acknowledge that you use it at your own discretion and assume all risks associated with its limitations and potential errors.
Loading

0 comments on commit cb80fb1

Please sign in to comment.