Skip to content

Commit

Permalink
[models] remove provider octoAI
Browse files Browse the repository at this point in the history
  • Loading branch information
pkelaita committed Sep 30, 2024
1 parent d9f2364 commit cee2cef
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 150 deletions.
32 changes: 0 additions & 32 deletions l2m2/client/base_llm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"google": "GOOGLE_API_KEY",
"groq": "GROQ_API_KEY",
"replicate": "REPLICATE_API_TOKEN",
"octoai": "OCTOAI_TOKEN",
"mistral": "MISTRAL_API_KEY",
}

Expand Down Expand Up @@ -669,37 +668,6 @@ async def _call_replicate(
)
return "".join(result["output"])

async def _call_octoai(
self,
model_id: str,
prompt: str,
system_prompt: Optional[str],
params: Dict[str, Any],
timeout: Optional[int],
memory: Optional[BaseMemory],
json_mode: bool,
json_mode_strategy: JsonModeStrategy,
_: Dict[str, Any], # TODO refactor
) -> str:
if isinstance(memory, ChatMemory) and model_id == "mixtral-8x22b-instruct":
raise LLMOperationError(
"Chat memory is not supported with mixtral-8x22b via OctoAI. Try using"
+ " ExternalMemory instead, or ChatMemory with a different model/provider."
)

return await self._generic_openai_spec_call(
"octoai",
model_id,
prompt,
system_prompt,
params,
timeout,
memory,
json_mode,
json_mode_strategy,
{},
)

async def _generic_openai_spec_call(
self,
provider: str,
Expand Down
107 changes: 0 additions & 107 deletions l2m2/model_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,6 @@ class ModelEntry(TypedDict):
"Content-Type": "application/json",
},
},
"octoai": {
"name": "OctoAI",
"homepage": "https://octoai.cloud/",
"endpoint": "https://text.octoai.run/v1/chat/completions",
"headers": {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
},
}

MODEL_INFO: Dict[str, Dict[str, ModelEntry]] = {
Expand Down Expand Up @@ -350,20 +341,6 @@ class ModelEntry(TypedDict):
},
"extras": {"json_mode_arg": {"response_format": {"type": "json_object"}}},
},
"octoai": {
"model_id": "mixtral-8x22b-instruct",
"params": {
"temperature": {
"default": PROVIDER_DEFAULT,
"max": 2.0,
},
"max_tokens": {
"default": PROVIDER_DEFAULT,
"max": INF,
},
},
"extras": {},
},
},
"mixtral-8x7b": {
"mistral": {
Expand All @@ -380,20 +357,6 @@ class ModelEntry(TypedDict):
},
"extras": {"json_mode_arg": {"response_format": {"type": "json_object"}}},
},
"octoai": {
"model_id": "mixtral-8x7b-instruct",
"params": {
"temperature": {
"default": PROVIDER_DEFAULT,
"max": 2.0,
},
"max_tokens": {
"default": PROVIDER_DEFAULT,
"max": INF,
},
},
"extras": {},
},
"groq": {
"model_id": "mixtral-8x7b-32768",
"params": {
Expand Down Expand Up @@ -424,20 +387,6 @@ class ModelEntry(TypedDict):
},
"extras": {"json_mode_arg": {"response_format": {"type": "json_object"}}},
},
"octoai": {
"model_id": "mistral-7b-instruct",
"params": {
"temperature": {
"default": PROVIDER_DEFAULT,
"max": 2.0,
},
"max_tokens": {
"default": PROVIDER_DEFAULT,
"max": INF,
},
},
"extras": {},
},
},
"gemma-7b": {
"groq": {
Expand Down Expand Up @@ -532,36 +481,8 @@ class ModelEntry(TypedDict):
},
"extras": {},
},
"octoai": {
"model_id": "meta-llama-3-70b-instruct",
"params": {
"temperature": {
"default": PROVIDER_DEFAULT,
"max": 2.0,
},
"max_tokens": {
"default": PROVIDER_DEFAULT,
"max": INF,
},
},
"extras": {},
},
},
"llama-3.1-8b": {
"octoai": {
"model_id": "meta-llama-3.1-8b-instruct",
"params": {
"temperature": {
"default": PROVIDER_DEFAULT,
"max": 2.0,
},
"max_tokens": {
"default": PROVIDER_DEFAULT,
"max": INF,
},
},
"extras": {},
},
"groq": {
"model_id": "llama-3.1-8b-instant",
"params": {
Expand All @@ -578,20 +499,6 @@ class ModelEntry(TypedDict):
},
},
"llama-3.1-70b": {
"octoai": {
"model_id": "meta-llama-3.1-70b-instruct",
"params": {
"temperature": {
"default": PROVIDER_DEFAULT,
"max": 2.0,
},
"max_tokens": {
"default": PROVIDER_DEFAULT,
"max": INF,
},
},
"extras": {},
},
"groq": {
"model_id": "llama-3.1-70b-versatile",
"params": {
Expand Down Expand Up @@ -623,20 +530,6 @@ class ModelEntry(TypedDict):
},
"extras": {},
},
"octoai": {
"model_id": "meta-llama-3.1-405b-instruct",
"params": {
"temperature": {
"default": PROVIDER_DEFAULT,
"max": 2.0,
},
"max_tokens": {
"default": PROVIDER_DEFAULT,
"max": INF,
},
},
"extras": {},
},
},
"llama-3.2-1b": {
"groq": {
Expand Down
11 changes: 0 additions & 11 deletions tests/l2m2/client/test_base_llm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

# Model/provider pairs which don't support ChatMemory
CHAT_MEMORY_UNSUPPORTED_MODELS = {
"octoai": "mixtral-8x22b",
"replicate": "llama-3-8b", # Applies to all models via Replicate
}

Expand Down Expand Up @@ -328,16 +327,6 @@ async def test_call_replicate(mock_get_extra_message, mock_llm_post, llm_client)
await _generic_test_call(llm_client, "replicate", "llama-3-8b")


@pytest.mark.asyncio
@patch(LLM_POST_PATH)
@patch(GET_EXTRA_MESSAGE_PATH)
async def test_call_octoai(mock_get_extra_message, mock_llm_post, llm_client):
mock_get_extra_message.return_value = "extra message"
mock_return_value = {"choices": [{"message": {"content": "response"}}]}
mock_llm_post.return_value = mock_return_value
await _generic_test_call(llm_client, "octoai", "llama-3.1-405b")


@pytest.mark.asyncio
@patch(LLM_POST_PATH)
async def test_call_google_gemini_fails(mock_llm_post, llm_client):
Expand Down

0 comments on commit cee2cef

Please sign in to comment.