mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-25 00:36:55 +02:00
Merge pull request #1820 from cmodi-meta/llama-api-support
Add Llama API Support
This commit is contained in:
commit
5aae56e863
7 changed files with 30 additions and 0 deletions
6
config/examples/llamaapi-Llama-3.3-70B-Instruct.yaml
Normal file
6
config/examples/llamaapi-Llama-3.3-70B-Instruct.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
llm:
|
||||
api_type: llama_api
|
||||
base_url: "https://api.llama.com/compat/v1/"
|
||||
api_key: "YOUR_API_KEY"
|
||||
model: "Llama-3.3-70B-Instruct"
|
||||
6
config/examples/llamaapi-Llama-3.3-8B-Instruct.yaml
Normal file
6
config/examples/llamaapi-Llama-3.3-8B-Instruct.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
llm:
|
||||
api_type: llama_api
|
||||
base_url: "https://api.llama.com/compat/v1/"
|
||||
api_key: "YOUR_API_KEY"
|
||||
model: "Llama-3.3-8B-Instruct"
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
llm:
|
||||
api_type: llama_api
|
||||
base_url: "https://api.llama.com/compat/v1/"
|
||||
api_key: "YOUR_API_KEY"
|
||||
model: "Llama-4-Scout-17B-16E-Instruct-FP8"
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
llm:
|
||||
api_type: llama_api
|
||||
base_url: "https://api.llama.com/compat/v1/"
|
||||
api_key: "YOUR_API_KEY"
|
||||
model: "Llama-4-Maverick-17B-128E-Instruct-FP8"
|
||||
|
|
@ -43,6 +43,7 @@ class LLMType(Enum):
|
|||
OPENROUTER_REASONING = "openrouter_reasoning"
|
||||
BEDROCK = "bedrock"
|
||||
ARK = "ark" # https://www.volcengine.com/docs/82379/1263482#python-sdk
|
||||
LLAMA_API = "llama_api"
|
||||
|
||||
def __missing__(self, key):
|
||||
return self.OPENAI
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ from metagpt.utils.token_counter import (
|
|||
LLMType.DEEPSEEK,
|
||||
LLMType.SILICONFLOW,
|
||||
LLMType.OPENROUTER,
|
||||
LLMType.LLAMA_API,
|
||||
]
|
||||
)
|
||||
class OpenAILLM(BaseLLM):
|
||||
|
|
|
|||
|
|
@ -113,6 +113,10 @@ TOKEN_COSTS = {
|
|||
"doubao-pro-128k-240515": {"prompt": 0.0007, "completion": 0.0013},
|
||||
"llama3-70b-llama3-70b-instruct": {"prompt": 0.0, "completion": 0.0},
|
||||
"llama3-8b-llama3-8b-instruct": {"prompt": 0.0, "completion": 0.0},
|
||||
"llama-4-Scout-17B-16E-Instruct-FP8" : {"prompt": 0.0, "completion": 0.0}, # start, for Llama API
|
||||
"llama-4-Maverick-17B-128E-Instruct-FP8": {"prompt": 0.0, "completion": 0.0},
|
||||
"llama-3.3-8B-Instruct": {"prompt": 0.0, "completion": 0.0},
|
||||
"llama-3.3-70B-Instruct": {"prompt": 0.0, "completion": 0.0}, # end, for Llama API
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue