Skip to content

Commit

Permalink
Merge branch 'main' into add-nano-gpt-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
odilitime authored Dec 10, 2024
2 parents f904d5e + c62a518 commit e432a83
Show file tree
Hide file tree
Showing 37 changed files with 2,784 additions and 1,538 deletions.
25 changes: 21 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ DISCORD_VOICE_CHANNEL_ID= # The ID of the voice channel the bot should join (opt
# AI Model API Keys
OPENAI_API_KEY= # OpenAI API key, starting with sk-

# Eternal AI's Decentralized Inference API
ETERNALAI_URL=
ETERNALAI_MODEL= #Default: "neuralmagic/Meta-Llama-3.1-405B-Instruct-quantized.w4a16"
ETERNALAI_API_KEY=

GROK_API_KEY= # GROK API Key
Expand All @@ -18,6 +20,13 @@ ALI_BAILIAN_API_KEY= # Ali Bailian API Key
VOLENGINE_API_KEY= # VolEngine API Key
NANOGPT_API_KEY= # NanoGPT API Key

HYPERBOLIC_API_KEY= # Hyperbolic API Key
HYPERBOLIC_MODEL=
IMAGE_HYPERBOLIC_MODEL= # Default: FLUX.1-dev
SMALL_HYPERBOLIC_MODEL= # Default: meta-llama/Llama-3.2-3B-Instruct
MEDIUM_HYPERBOLIC_MODEL= # Default: meta-llama/Meta-Llama-3.1-70B-Instruct
LARGE_HYPERBOLIC_MODEL= # Default: meta-llama/Meta-Llama-3.1-405-Instruct

# Speech Synthesis
ELEVENLABS_XI_API_KEY= # API key from elevenlabs

Expand Down Expand Up @@ -101,10 +110,10 @@ ANTHROPIC_API_KEY= # For Claude
HEURIST_API_KEY= # Get from https://heurist.ai/dev-access

# Heurist Models
SMALL_HEURIST_LANGUAGE_MODEL=
MEDIUM_HEURIST_LANGUAGE_MODEL=
LARGE_HEURIST_LANGUAGE_MODEL=
HEURIST_IMAGE_MODEL=
SMALL_HEURIST_MODEL= # Default: meta-llama/llama-3-70b-instruct
MEDIUM_HEURIST_MODEL= # Default: meta-llama/llama-3-70b-instruct
LARGE_HEURIST_MODEL= # Default: meta-llama/llama-3.1-405b-instruct
HEURIST_IMAGE_MODEL= # Default: PepeXL

# Gaianet Configuration
GAIANET_MODEL=
Expand Down Expand Up @@ -220,3 +229,11 @@ INTERNET_COMPUTER_ADDRESS=
# Aptos
APTOS_PRIVATE_KEY= # Aptos private key
APTOS_NETWORK= # must be one of mainnet, testnet


# AWS S3 Configuration Settings for File Upload
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
AWS_S3_BUCKET=
AWS_S3_UPLOAD_PATH=
17 changes: 13 additions & 4 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
validateCharacterConfig,
} from "@ai16z/eliza";
import { zgPlugin } from "@ai16z/plugin-0g";
import { goatPlugin } from "@ai16z/plugin-goat";
import createGoatPlugin from "@ai16z/plugin-goat";
import { bootstrapPlugin } from "@ai16z/plugin-bootstrap";
// import { buttplugPlugin } from "@ai16z/plugin-buttplug";
import {
Expand Down Expand Up @@ -275,6 +275,11 @@ export function getTokenForProvider(
character.settings?.secrets?.NANOGPT_API_KEY ||
settings.NANOGPT_API_KEY
);
case ModelProviderName.HYPERBOLIC:
return (
character.settings?.secrets?.HYPERBOLIC_API_KEY ||
settings.HYPERBOLIC_API_KEY
);
}
}

Expand Down Expand Up @@ -359,7 +364,7 @@ function getSecret(character: Character, secret: string) {

let nodePlugin: any | undefined;

export function createAgent(
export async function createAgent(
character: Character,
db: IDatabaseAdapter,
cache: ICacheManager,
Expand All @@ -373,6 +378,10 @@ export function createAgent(

nodePlugin ??= createNodePlugin();

const goatPlugin = await createGoatPlugin((secret) =>
getSecret(character, secret)
);

return new AgentRuntime({
databaseAdapter: db,
token,
Expand All @@ -392,7 +401,7 @@ export function createAgent(
: null,
getSecret(character, "EVM_PRIVATE_KEY") ||
(getSecret(character, "WALLET_PUBLIC_KEY") &&
!getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
? evmPlugin
: null,
getSecret(character, "ZEROG_PRIVATE_KEY") ? zgPlugin : null,
Expand Down Expand Up @@ -460,7 +469,7 @@ async function startAgent(character: Character, directClient) {
await db.init();

const cache = intializeDbCache(character, db);
const runtime = createAgent(character, db, cache, token);
const runtime = await createAgent(character, db, cache, token);

await runtime.initialize();

Expand Down
48 changes: 29 additions & 19 deletions docs/api/enumerations/ModelProviderName.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:214](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L214)
[packages/core/src/types.ts:215](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L215)

***

Expand All @@ -22,7 +22,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:215](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L215)
[packages/core/src/types.ts:216](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L216)

***

Expand All @@ -32,7 +32,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:216](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L216)
[packages/core/src/types.ts:217](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L217)

***

Expand All @@ -42,7 +42,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:217](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L217)
[packages/core/src/types.ts:218](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L218)

***

Expand All @@ -52,7 +52,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:218](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L218)
[packages/core/src/types.ts:219](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L219)

***

Expand All @@ -62,7 +62,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:219](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L219)
[packages/core/src/types.ts:220](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L220)

***

Expand All @@ -72,7 +72,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:220](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L220)
[packages/core/src/types.ts:221](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L221)

***

Expand All @@ -82,7 +82,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:221](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L221)
[packages/core/src/types.ts:222](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L222)

***

Expand All @@ -92,7 +92,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:222](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L222)
[packages/core/src/types.ts:223](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L223)

***

Expand All @@ -102,7 +102,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:223](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L223)
[packages/core/src/types.ts:224](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L224)

***

Expand All @@ -112,7 +112,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:224](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L224)
[packages/core/src/types.ts:225](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L225)

***

Expand All @@ -122,7 +122,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:225](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L225)
[packages/core/src/types.ts:226](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L226)

***

Expand All @@ -132,7 +132,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:226](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L226)
[packages/core/src/types.ts:227](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L227)

***

Expand All @@ -142,7 +142,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:227](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L227)
[packages/core/src/types.ts:228](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L228)

***

Expand All @@ -152,7 +152,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:228](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L228)
[packages/core/src/types.ts:229](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L229)

***

Expand All @@ -162,7 +162,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:229](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L229)
[packages/core/src/types.ts:230](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L230)

***

Expand All @@ -172,7 +172,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:230](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L230)
[packages/core/src/types.ts:231](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L231)

***

Expand All @@ -182,7 +182,7 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:231](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L231)
[packages/core/src/types.ts:232](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L232)

***

Expand All @@ -192,4 +192,14 @@ Available model providers
#### Defined in

[packages/core/src/types.ts:232](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L232)
[packages/core/src/types.ts:233](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L233)

***

### HYPERBOLIC

> **HYPERBOLIC**: `"hyperbolic"`
#### Defined in

[packages/core/src/types.ts:234](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L234)
4 changes: 4 additions & 0 deletions docs/api/type-aliases/Models.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ Model configurations by provider

> **volengine**: [`Model`](Model.md)
### hyperbolic

> **hyperbolic**: [`Model`](Model.md)
## Defined in

[packages/core/src/types.ts:188](https://github.com/monilpat/eliza/blob/main/packages/core/src/types.ts#L188)
2 changes: 1 addition & 1 deletion docs/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To begin building your own AI agents with Eliza, follow these steps:

1. **Install Python, Node.js and pnpm**: Ensure you have the necessary software prerequisites installed on your system. We use node v23.
2. **Set up your environment**: Create a `.env` file and populate it with the required API keys, database configuration, and platform-specific tokens.
3. **Install Eliza**: Use the command `npm install eliza` or `pnpm install eliza` to install the Eliza package.
3. **Install Eliza**: Use the command `npm install @ai16z/eliza` or `pnpm add @ai16z/eliza` to install the Eliza package.
4. **Configure your database**: Eliza currently relies on Supabase for local development. Follow the instructions in the documentation to set up your Supabase project and database.
5. **Define your agent's character**: Create a character file using the provided JSON format to specify your agent's personality, knowledge, and behavior.
6. **Run Eliza locally**: Use the provided commands to start the Eliza framework and interact with your agent.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Before getting started with Eliza, ensure you have:
Eliza supports multiple AI models:

- **Heurist**: Set `modelProvider: "heurist"` in your character file. Most models are uncensored.
- LLM: Select available LLMs [here](https://docs.heurist.ai/dev-guide/supported-models#large-language-models-llms) and configure `SMALL_HEURIST_LANGUAGE_MODEL`,`MEDIUM_HEURIST_LANGUAGE_MODEL`,`LARGE_HEURIST_LANGUAGE_MODEL`
- LLM: Select available LLMs [here](https://docs.heurist.ai/dev-guide/supported-models#large-language-models-llms) and configure `SMALL_HEURIST_MODEL`,`MEDIUM_HEURIST_MODEL`,`LARGE_HEURIST_MODEL`
- Image Generation: Select available Stable Diffusion or Flux models [here](https://docs.heurist.ai/dev-guide/supported-models#image-generation-models) and configure `HEURIST_IMAGE_MODEL` (default is FLUX.1-dev)
- **Llama**: Set `XAI_MODEL=meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo`
- **Grok**: Set `XAI_MODEL=grok-beta`
Expand Down
Loading

0 comments on commit e432a83

Please sign in to comment.