diff --git a/autogpt_platform/backend/backend/blocks/llm.py b/autogpt_platform/backend/backend/blocks/llm.py index 4b0e7f3d08..50f5b4f092 100644 --- a/autogpt_platform/backend/backend/blocks/llm.py +++ b/autogpt_platform/backend/backend/blocks/llm.py @@ -676,7 +676,11 @@ async def llm_call( client = openai.OpenAI( base_url="https://api.aimlapi.com/v2", api_key=credentials.api_key.get_secret_value(), - default_headers={"X-Project": "AutoGPT"}, + default_headers={ + "X-Project": "AutoGPT", + "X-Title": "AutoGPT", + "HTTP-Referer": "https://github.com/Significant-Gravitas/AutoGPT", + }, ) completion = client.chat.completions.create( diff --git a/docs/content/imgs/aimlapi/Step 1 AutoGPT Running.png b/docs/content/imgs/aimlapi/Step 1 AutoGPT Running.png new file mode 100644 index 0000000000..66600f6105 Binary files /dev/null and b/docs/content/imgs/aimlapi/Step 1 AutoGPT Running.png differ diff --git a/docs/content/imgs/aimlapi/Step 2 Build Screen.png b/docs/content/imgs/aimlapi/Step 2 Build Screen.png new file mode 100644 index 0000000000..45d6c6700f Binary files /dev/null and b/docs/content/imgs/aimlapi/Step 2 Build Screen.png differ diff --git a/docs/content/imgs/aimlapi/Step 3 AI Block.png b/docs/content/imgs/aimlapi/Step 3 AI Block.png new file mode 100644 index 0000000000..b8123cfc66 Binary files /dev/null and b/docs/content/imgs/aimlapi/Step 3 AI Block.png differ diff --git a/docs/content/imgs/aimlapi/Step 4 AI Generator Block.png b/docs/content/imgs/aimlapi/Step 4 AI Generator Block.png new file mode 100644 index 0000000000..92a882351a Binary files /dev/null and b/docs/content/imgs/aimlapi/Step 4 AI Generator Block.png differ diff --git a/docs/content/imgs/aimlapi/Step 5 AIMLAPI Models.png b/docs/content/imgs/aimlapi/Step 5 AIMLAPI Models.png new file mode 100644 index 0000000000..3f7727da6d Binary files /dev/null and b/docs/content/imgs/aimlapi/Step 5 AIMLAPI Models.png differ diff --git a/docs/content/imgs/aimlapi/Step 6.1 Key Placeholder.png b/docs/content/imgs/aimlapi/Step 6.1 Key Placeholder.png new file mode 100644 index 0000000000..43ea616f51 Binary files /dev/null and b/docs/content/imgs/aimlapi/Step 6.1 Key Placeholder.png differ diff --git a/docs/content/imgs/aimlapi/Step 6.2 No Fill Key Placeholder.png b/docs/content/imgs/aimlapi/Step 6.2 No Fill Key Placeholder.png new file mode 100644 index 0000000000..95363da76c Binary files /dev/null and b/docs/content/imgs/aimlapi/Step 6.2 No Fill Key Placeholder.png differ diff --git a/docs/content/imgs/aimlapi/Step 6.3 Filled Key Placeholder.png b/docs/content/imgs/aimlapi/Step 6.3 Filled Key Placeholder.png new file mode 100644 index 0000000000..072a61727a Binary files /dev/null and b/docs/content/imgs/aimlapi/Step 6.3 Filled Key Placeholder.png differ diff --git a/docs/content/imgs/aimlapi/Step 6.4 Overview.png b/docs/content/imgs/aimlapi/Step 6.4 Overview.png new file mode 100644 index 0000000000..f4b605ae89 Binary files /dev/null and b/docs/content/imgs/aimlapi/Step 6.4 Overview.png differ diff --git a/docs/content/imgs/aimlapi/Step 7.1 Save.png b/docs/content/imgs/aimlapi/Step 7.1 Save.png new file mode 100644 index 0000000000..275e812567 Binary files /dev/null and b/docs/content/imgs/aimlapi/Step 7.1 Save.png differ diff --git a/docs/content/imgs/aimlapi/Step 8 Run.png b/docs/content/imgs/aimlapi/Step 8 Run.png new file mode 100644 index 0000000000..c4d7849331 Binary files /dev/null and b/docs/content/imgs/aimlapi/Step 8 Run.png differ diff --git a/docs/content/imgs/aimlapi/Step 9 Output.png b/docs/content/imgs/aimlapi/Step 9 Output.png new file mode 100644 index 0000000000..7176c5edc0 Binary files /dev/null and b/docs/content/imgs/aimlapi/Step 9 Output.png differ diff --git a/docs/content/index.md b/docs/content/index.md index cd69844364..d22bb2885e 100644 --- a/docs/content/index.md +++ b/docs/content/index.md @@ -64,11 +64,12 @@ You can learn more under: [Build your own Blocks](platform/new_blocks.md) The platform comes pre-integrated with cutting-edge LLM providers: -- OpenAI -- Anthropic -- AI/ML API -- Groq -- Llama +- OpenAI - https://openai.com/ +- Anthropic - https://www.anthropic.com/ +- Groq - https://groq.com/ +- Llama - https://llamaindex.ai/ +- AI/ML API - [https://aimlapi.com/](https://aimlapi.com/?utm_source=autogpt&utm_medium=github&utm_campaign=integration) + - AI/ML API provides 300+ AI models including Deepseek, Gemini, ChatGPT. The models run at enterprise-grade rate limits and uptimes. ## License Overview diff --git a/docs/content/platform/aimlapi.md b/docs/content/platform/aimlapi.md new file mode 100644 index 0000000000..785fc50e3a --- /dev/null +++ b/docs/content/platform/aimlapi.md @@ -0,0 +1,139 @@ + +# ๐Ÿง  Running AI/ML API with AutoGPT + +Follow these steps to connect **AI/ML API** with the **AutoGPT** platform for high-performance AI text generation. + +--- + +## โœ… Prerequisites + +1. Make sure you have gone through and completed the [AutoGPT Setup Guide](https://docs.agpt.co/platform/getting-started/), and AutoGPT is running locally at `http://localhost:3000`. +2. You have an **API key** from [AI/ML API](https://aimlapi.com/app/keys?utm_source=autogpt&utm_medium=github&utm_campaign=integration). + +--- + +## โš™๏ธ Setup Steps + +### 1. Start AutoGPT Locally + +Follow the official guide: +[๐Ÿ“– AutoGPT Getting Started Guide](https://docs.agpt.co/platform/getting-started/) + +Make sure AutoGPT is running and accessible at: +[http://localhost:3000](http://localhost:3000) + +> ๐Ÿ’ก Keep AutoGPT running in a terminal or Docker throughout the session. + +![Step 1 AutoGPT Running](../imgs/aimlapi/Step%201%20AutoGPT%20Running.png) + +--- + +### 2. Open the Visual Builder + +Open your browser and go to: +[http://localhost:3000/build](http://localhost:3000/build) + +Or click **โ€œBuildโ€** in the navigation bar. + +![Step 2 Build Screen](../imgs/aimlapi/Step%202%20Build%20Screen.png) + +--- + +### 3. Add an AI Text Generator Block + +1. Click the **"Blocks"** button on the left sidebar. + +![Step 3 AI Block](../imgs/aimlapi/Step%203%20AI%20Block.png) + +2. In the search bar, type `AI Text Generator`. +3. Drag the block into the canvas. + +![Step 4 AI Generator Block](../imgs/aimlapi/Step%204%20AI%20Generator%20Block.png) + +--- + +### 4. Select an AI/ML API Model + +Click the AI Text Generator block to configure it. + +In the **LLM Model** dropdown, select one of the supported models from AI/ML API: + +![Step 5 AIMLAPI Models](../imgs/aimlapi/Step%205%20AIMLAPI%20Models.png) + +| Model ID | Speed | Reasoning Quality | Best For | +| ---------------------------------------------- | ------ | ----------------- | ------------------------ | +| `Qwen/Qwen2.5-72B-Instruct-Turbo` | Medium | High | Text-based tasks | +| `nvidia/llama-3.1-nemotron-70b-instruct` | Medium | High | Analytics and reasoning | +| `meta-llama/Llama-3.3-70B-Instruct-Turbo` | Low | Very High | Complex multi-step tasks | +| `meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo` | Low | Very High | Deep reasoning | +| `meta-llama/Llama-3.2-3B-Instruct-Turbo` | High | Medium | Fast responses | + +> โœ… These models are available via OpenAI-compatible API from [AI/ML API](https://aimlapi.com/app/?utm_source=autogpt&utm_medium=github&utm_campaign=integration) + +--- + +### 5. Configure the Prompt and API Key + +Inside the **AI Text Generator** block: + +1. Enter your prompt text in the **Prompt** field. +2. Enter your **AI/ML API Key** in the designated field. + +๐Ÿ” You can get your key from: +[https://aimlapi.com/app/keys/](https://aimlapi.com/app/keys?utm_source=autogpt&utm_medium=github&utm_campaign=integration) + +![Key Placeholder](../imgs/aimlapi/Step%206.1%20Key%20Placeholder.png) + +![Key Empty](../imgs/aimlapi/Step%206.2%20No%20Fill%20Key%20Placeholder.png) + +![Key Filled](../imgs/aimlapi/Step%206.3%20Filled%20Key%20Placeholder.png) + +![Overview](../imgs/aimlapi/Step%206.4%20Overview.png) + +--- + +### 6. Save Your Agent + +Click the **โ€œSaveโ€** button at the top-right of the builder interface: + +1. Give your agent a name (e.g., `aimlapi_test_agent`). +2. Click **โ€œSave Agentโ€** to confirm. + +![Save Agent](../imgs/aimlapi/Step%207.1%20Save.png) + +> ๐Ÿ’ก Saving allows reuse, scheduling, and chaining in larger workflows. + +--- + +### 7. Run Your Agent + +From the workspace: + +1. Press **โ€œRunโ€** next to your saved agent. +2. The request will be sent to the selected AI/ML API model. + +![Run Agent](../imgs/aimlapi/Step%208%20Run.png) + +--- + +### 8. View the Output + +1. Scroll to the **AI Text Generator** block. +2. Check the **Output** panel below it. +3. You can copy, export, or pass the result to further blocks. + +![Agent Output](../imgs/aimlapi/Step%209%20Output.png) + +--- + +## ๐Ÿ”„ Expand Your Agent + +Now that AI/ML API is connected, expand your workflow by chaining additional blocks: + +* ๐Ÿ”ง **Tools** โ€“ fetch URLs, call APIs, scrape data +* ๐Ÿง  **Memory** โ€“ retain context across interactions +* โš™๏ธ **Actions / Chains** โ€“ create full pipelines + +--- + +๐ŸŽ‰ Youโ€™re now generating AI responses using enterprise-grade models from **AI/ML API** in **AutoGPT**! diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 1d7b17e811..126dfbc154 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -19,6 +19,7 @@ nav: - Agent Blocks: platform/agent-blocks.md - Build your own Blocks: platform/new_blocks.md - Using Ollama: platform/ollama.md + - Using AI/ML API: platform/aimlapi.md - Using D-ID: platform/d_id.md - Blocks: platform/blocks/blocks.md - Contributing: