Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add hyperbolic api to eliza #828

Merged
merged 5 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ GOOGLE_GENERATIVE_AI_API_KEY= # Gemini API key
ALI_BAILIAN_API_KEY= # Ali Bailian API Key
VOLENGINE_API_KEY= # VolEngine API Key

HYPERBOLIC_API_KEY= # Hyperbolic API Key
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to add the link to api in the comments thanks otherwise LGTM!


# Speech Synthesis
ELEVENLABS_XI_API_KEY= # API key from elevenlabs

Expand Down
5 changes: 5 additions & 0 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ export function getTokenForProvider(
character.settings?.secrets?.VOLENGINE_API_KEY ||
settings.VOLENGINE_API_KEY
);
case ModelProviderName.HYPERBOLIC:
return (
character.settings?.secrets?.HYPERBOLIC_API_KEY ||
settings.HYPERBOLIC_API_KEY
);
}
}

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)
1 change: 1 addition & 0 deletions packages/core/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export async function generateText({
case ModelProviderName.ALI_BAILIAN:
case ModelProviderName.VOLENGINE:
case ModelProviderName.LLAMACLOUD:
case ModelProviderName.HYPERBOLIC:
case ModelProviderName.TOGETHER: {
elizaLogger.debug("Initializing OpenAI model.");
const openai = createOpenAI({ apiKey, baseURL: endpoint });
Expand Down
15 changes: 15 additions & 0 deletions packages/core/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,21 @@ export const models: Models = {
[ModelClass.EMBEDDING]: "doubao-embedding",
},
},
[ModelProviderName.HYPERBOLIC]: {
endpoint: "https://api.hyperbolic.xyz/v1",
settings: {
stop: [],
maxInputTokens: 128000,
maxOutputTokens: 8192,
temperature: 0.6,
},
model: {
[ModelClass.SMALL]: "meta-llama/Llama-3.2-3B-Instruct",
[ModelClass.MEDIUM]: "meta-llama/Meta-Llama-3.1-70B-Instruct",
[ModelClass.LARGE]: "meta-llama/Meta-Llama-3.1-405-Instruct",
[ModelClass.IMAGE]: "FLUX.1-dev",
},
},
};

export function getModel(provider: ModelProviderName, type: ModelClass) {
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export type Models = {
[ModelProviderName.GAIANET]: Model;
[ModelProviderName.ALI_BAILIAN]: Model;
[ModelProviderName.VOLENGINE]: Model;
[ModelProviderName.HYPERBOLIC]: Model;
};

/**
Expand All @@ -230,6 +231,7 @@ export enum ModelProviderName {
GAIANET = "gaianet",
ALI_BAILIAN = "ali_bailian",
VOLENGINE = "volengine",
HYPERBOLIC = "hyperbolic",
}

/**
Expand Down
Loading