Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Improve readme and contrib guide

Tomas Valenta09a9d28b3bd4
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d0fb5c2e8..c52459529 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,14 +1,14 @@
# Contributing
-If you want to contribute open a PR, issue, or start a discussion on our [Discord](https://discord.gg/dSBY3ms2Qr).
+If you want to contribute, open a PR, issue, or start a discussion on our [Discord](https://discord.gg/dSBY3ms2Qr).
# πŸ€– Adding a new model provider
If you want to add a new model provider (like OpenAI or HuggingFace) complete the following steps and create a PR.
-When you add a provider you can also add a specific models (like OpenAI's GPT-4) under that provider.
+When you add a provider you can also add a specific model (like OpenAI's GPT-4) under that provider.
Here is an [example code for adding a new provider](./NEW_PROVIDER_EXAMPLE.md).
-## 1. Add provider to **frontend**
+## 1. Add the provider to **frontend**
- Add provider name to `ModelProvider` enum in [state/model.ts](state/model.ts)
- Add provider and models template to `modelTemplates` object in [state/model.ts](state/model.ts)
- `creds` and `args` defined in the `modelTemplates` are accessible on backend in `get_model` under their exact names in `config["args"]` object.
@@ -17,12 +17,12 @@ Here is an [example code for adding a new provider](./NEW_PROVIDER_EXAMPLE.md).
## 2. Add provider to **backend** ([api-service/models/base.py](api-service/models/base.py))
- Add provider name to `ModelProvider` enum
-- Add provider integration (implementing LangChain's `BaseLanguageModel`) to `get_model` function. You can use an existing integration from LangChain or crate a new integration from scratch.
+- Add provider integration (implementing LangChain's `BaseLanguageModel`) to `get_model` function. You can use an existing integration from LangChain or create a new integration from scratch.
The new provider integrations should be placed in `api-service/models/providers/`.
## Provider integrations
-We use [LangChain](https://github.com/hwchase17/langchain) under the hood so if you are adding a new integration you have to implement the `BaseLanguageModel` class. That basically means just implementing the `_acall` which is an async method that calls the model with prompt and returns the output.
+We use [LangChain](https://github.com/hwchase17/langchain) under the hood, so if you are adding a new integration you have to implement the `BaseLanguageModel` class. That means just implementing the `_acall` async method that calls the model with a prompt and returns the output.
### **Using [LangChain](https://python.langchain.com/en/latest/modules/models/llms/integrations.html) integration**
You can often use existing LangChain integrations to add new model providers to e2b with just a few modifications.
@@ -67,53 +67,4 @@ class NewModelProviderWithStreaming(LLM):
```
## 3. Test
-Test if the provider works by starting the app, selecting the provider and model in the "Model" sidebar menu and trying to "Run" it.
-
-Add a screenshot of the results to the PR if you can.
-
-
-# πŸ’» Development setup
-For developing with hot reloading and contributing to the project you may want to run the app locally without Docker Compose (`npm start` command). Here are the steps for how to do it.
-
-You will need:
-- OpenAI API key (support for more and custom models coming soon)
-- Docker
-- Node.js *16+*
-- Python *3.10+*
-- Poetry *1.3.2+*
-- Free ports 3000, 49155, 49160, 54321, 54322
-
-## 1. Install dependencies
-```
-npm run install:all
-```
-
-## 2. Start local Supabase
-```
-npm run db:start
-```
-
-> Local Supabase runs in the background - to stop it you have to run `npm run db:stop`.
-
-## 3. Add env vars
-Create `.env` file by copying the [`.env.example`](.env.example)
-```
-cp .env.example .env
-```
-and fill in the following variables:
-- `SUPABASE_SERVICE_ROLE_KEY` - Supabase service role key you got in the previous step as `service_role key: eyJh......`
-- `NEXT_PUBLIC_SUPABASE_ANON_KEY` - Supabase anonymous key you got in the previous step as `anon key: eyJh......`
-
-## 4. Start the app
-```
-npm run dev
-```
-Then open the page on [http://localhost:3000](http://localhost:3000) and sign in with the testing credentials:
-
-**Email**
-
-
-**Password**
-
+Test if the provider works by starting the app, selecting the provider and model in the "Model" sidebar menu and trying to "Run" it. Then add a screenshot of agent steps to the PR.
diff --git a/README.md b/README.md
index 91daefdbe..250b0e60a 100644
--- a/README.md
+++ b/README.md
@@ -34,28 +34,71 @@ e2b currently supports building only REST servers in Node.js. Specifically using
# πŸš€ Get started
We're working on the cloud-hosted version. In the meantime, the fastest way try out e2b is to run it locally via Docker.
+## 🐳 Start e2b with Docker
You will need:
- [OpenAI API key](https://platform.openai.com/account/api-keys) (support for more and custom models coming soon)
- Docker
- Node.js *16+*
- Free ports 3000 (Next.js app), 54321 (Supabase API Gateway), 54322 (Supabase Database)
-> The first start of the Dockerized app is slower because it downloads and builds all the necessary containers. On a 2CPU 4GB RAM machine it takes cca. 6 minutes and doesn't require any interaction. The subsequent starts are way faster.
-
-## Start the app
+To start e2b run:
```
npm start
```
-Then open the page on [http://localhost:3000](http://localhost:3000).
-> `npm start` starts local Supabase in the background - to stop it you have to run `npm run stop`.
+Then open page on [http://localhost:3000](http://localhost:3000).
-> If you want to run non-containerize version of e2b use the [development setup here](CONTRIBUTING.md#πŸ’»-development-setup). This is useful if you want to leverage hot reloading and develop the project.
+`npm start` starts local Supabase in the background - to stop it you have to run `npm run stop`.
-# Features
+## πŸ’» Or start in development setup
+For developing with hot reloading and contributing to the project you may want to run the app locally without Docker (`npm start` command). Here are the steps for how to do it.
-## πŸ›  Bring your own X
+You will need:
+- OpenAI API key (support for more and custom models coming soon)
+- Docker (For starting the Supabase DB locally)
+- Node.js *16+*
+- Python *3.10+*
+- Poetry *1.3.2+*
+- Free ports 3000, 49155, 49160, 54321, 54322
+### 1. Install dependencies
+```
+npm run install:all
+```
+
+### 2. Start local Supabase
+```
+npm run db:start
+```
+
+Local Supabase runs in the background - to stop it you have to run `npm run db:stop`.
+
+### 3. Add env vars
+Create `.env` file by copying the [`.env.example`](.env.example)
+```
+cp .env.example .env
+```
+and fill in the following variables:
+- `SUPABASE_SERVICE_ROLE_KEY` - Supabase service role key you got in the previous step as `service_role key: eyJh......`
+- `NEXT_PUBLIC_SUPABASE_ANON_KEY` - Supabase anonymous key you got in the previous step as `anon key: eyJh......`
+
+### 4. Start the app
+```
+npm run dev
+```
+Then open page on [http://localhost:3000](http://localhost:3000) and sign in with the testing credentials:
+
+**Email**
+
+
+**Password**
+
+
+
+# Features
+## πŸ›  Bring your own X
While e2b will offer the "batteries-included" solution, our goal is to let users:
- **BYOM** - Bring Your Own Model
- **BYOP** - Bring Your Own Prompt
@@ -73,7 +116,7 @@ We think the AI-powered IDE for the future should be open-sourced and allow anyb
- [ ] Claude v1.3
- [ ] Claude Instant v1
-### **Model or provider you like isn't supported?**
+### **Model or model hosting provider you like isn't supported?**
πŸ‘‰ Please open the ["New model request" issue](https://github.com/e2b-dev/e2b/issues/new?assignees=&labels=new+model+request&template=new-model-request.md&title=) πŸ‘ˆ