Skip to content

Commit fb8461d

Browse files
Merge pull request #57 from mainframecomputer/feature/add-new-models
Feature/add new models
2 parents c97c0be + 4098c13 commit fb8461d

File tree

6 files changed

+41
-38
lines changed

6 files changed

+41
-38
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/mainframecomputer/orchestra/issues)
22
[![PyPI version](https://badge.fury.io/py/mainframe-orchestra.svg)](https://pypi.org/project/mainframe-orchestra/)
3-
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
3+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
44
[![Twitter](https://img.shields.io/twitter/follow/orchestraorg?label=Follow%20@orchestraorg&style=social)](https://twitter.com/orchestraorg)
55

66
# Orchestra
@@ -96,25 +96,25 @@ print(result)
9696
Orchestra supports a wide range of language models from a number of providers:
9797

9898
### OpenAI
99-
GPT-4o, GPT-4o Mini, & Custom defined models
99+
GPT-4.5-preview, GPT-4o, GPT-4o Mini, & Custom defined models
100100

101101
### Anthropic
102-
Claude 3 Haiku, Claude 3 Sonnet, Claude 3 Opus, Claude 3.5 Sonnet, Claude 3.7 Sonnet, & Custom defined models
102+
Claude 3 Haiku, Claude 3 Sonnet, Claude 3 Opus, Claude 3.5 Sonnet, Claude 3.7 Sonnet, & Custom defined models
103103

104104
### Openrouter
105-
GPT-4 Turbo, Claude 3 Opus, Mixtral 8x7B, Llama 3.1 405B, & Custom defined models
105+
GPT-4 Turbo, Claude 3 Opus, Mixtral 8x7B, Llama 3.1 405B, & Custom defined models
106106

107107
### Ollama
108-
Mistral, Mixtral, Llama 3.1, Qwen, Gemma, & Custom defined models
108+
Mistral, Mixtral, Llama 3.1, Qwen, Gemma, & Custom defined models
109109

110110
### Groq
111111
Mixtral 8x7B, Llama 3, Llama 3.1, Gemma, & Custom defined models
112112

113113
### TogetherAI
114-
Custom defined models
114+
Custom defined models
115115

116116
### Gemini
117-
Gemini 1.5 Flash, Gemini 1.5 Flash 8B, Gemini 1.5 Pro, & Custom defined models
117+
Gemini 1.5 Flash, Gemini 1.5 Flash 8B, Gemini 1.5 Pro, & Custom defined models
118118

119119
### Deepseek
120120
Deepseek Reasoner, Deepseek Chat, & Custom defined models

docs/src/llms.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Each class contains static methods corresponding to specific models offered by t
2121

2222
Orchestra supports a wide range of language models from various providers. Here's an overview of some supported models:
2323

24-
- OpenAI Models: GPT-3.5 Turbo, GPT-4 Turbo, GPT-4, GPT-4o
24+
- OpenAI Models: GPT-4.5-preview, GPT-4o, GPT-4, GPT-4 Turbo, GPT-3.5 Turbo
2525
- Anthropic Models: Claude-3 Opus, Claude-3 Sonnet, Claude-3 Haiku, Claude-3.5 Sonnet, Claude-3.7 Sonnet
26-
- Openrouter Models: Various models including Anthropic Claude, OpenAI GPT, Llama, Mistral AI, and more
26+
- Openrouter Models: Various models including Anthropic Claude, OpenAI GPT, Llama, Mistral AI
2727
- Ollama Models: Llama 3, Gemma, Mistral, Qwen, Phi-3, Llama 2, CodeLlama, LLaVA, Mixtral
2828
- Groq Models: Gemma, Llama3, Llama3.1, Mixtral
2929
- Togetherai Models: Meta Llama 3.1, Mixtral, Mistral, many other open source models

packages/python/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,25 +96,25 @@ print(result)
9696
Orchestra supports a wide range of language models from a number of providers:
9797

9898
### OpenAI
99-
GPT-4o, GPT-4o Mini, & Custom defined models
99+
GPT-4.5-preview, GPT-4o, GPT-4o Mini, & Custom defined models
100100

101101
### Anthropic
102-
Claude 3 Haiku, Claude 3 Sonnet, Claude 3 Opus, Claude 3.5 Sonnet, Claude 3.7 Sonnet, & Custom defined models
102+
Claude 3 Haiku, Claude 3 Sonnet, Claude 3 Opus, Claude 3.5 Sonnet, Claude 3.7 Sonnet, & Custom defined models
103103

104104
### Openrouter
105-
GPT-4 Turbo, Claude 3 Opus, Mixtral 8x7B, Llama 3.1 405B, & Custom defined models
105+
GPT-4 Turbo, Claude 3 Opus, Mixtral 8x7B, Llama 3.1 405B, & Custom defined models
106106

107107
### Ollama
108-
Mistral, Mixtral, Llama 3.1, Qwen, Gemma, & Custom defined models
108+
Mistral, Mixtral, Llama 3.1, Qwen, Gemma, & Custom defined models
109109

110110
### Groq
111111
Mixtral 8x7B, Llama 3, Llama 3.1, Gemma, & Custom defined models
112112

113113
### TogetherAI
114-
Custom defined models
114+
Custom defined models
115115

116116
### Gemini
117-
Gemini 1.5 Flash, Gemini 1.5 Flash 8B, Gemini 1.5 Pro, & Custom defined models
117+
Gemini 1.5 Flash, Gemini 1.5 Flash 8B, Gemini 1.5 Pro, & Custom defined models
118118

119119
### Deepseek
120120
Deepseek Reasoner, Deepseek Chat, & Custom defined models

packages/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "mainframe-orchestra"
3-
version = "0.0.24"
3+
version = "0.0.25"
44
description = "Mainframe-Orchestra is a lightweight, open-source agentic framework for building LLM based pipelines and self-orchestrating multi-agent teams"
55
authors = [
66
"Mainframe Computer Inc. <[email protected]>",

packages/python/src/mainframe_orchestra/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
# Copyright 2024 Mainframe-Orchestra Contributors. Licensed under Apache License 2.0.
55

6-
__version__ = "0.0.24"
6+
__version__ = "0.0.25"
77

88
from .task import Task
99
from .agent import Agent
@@ -33,7 +33,7 @@
3333
LinearTools,
3434
SemanticSplitter,
3535
SentenceSplitter,
36-
WhisperTools
36+
WhisperTools
3737
)
3838

3939
# Conditional imports for optional dependencies
@@ -47,7 +47,7 @@
4747
from .tools.yahoo_finance_tools import YahooFinanceTools
4848
from .tools.fred_tools import FredTools
4949
from .tools.audio_tools import WhisperTools, TextToSpeechTools
50-
from .tools.stripe_tools import StripeTools
50+
from .tools.stripe_tools import StripeTools
5151

5252
def __getattr__(name):
5353
package_map = {

packages/python/src/mainframe_orchestra/llm.py

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ async def stream_generator():
312312
# Non-streaming logic
313313
spinner.text = f"Waiting for {model} response..."
314314
response: OpenAIChatCompletion = await client.chat.completions.create(**request_params)
315-
315+
316316
content = response.choices[0].message.content
317317
spinner.succeed("Request completed")
318318

@@ -385,6 +385,7 @@ async def wrapper(
385385
gpt_4o_mini = custom_model("gpt-4o-mini")
386386
o1_mini = custom_model("o1-mini")
387387
o1_preview = custom_model("o1-preview")
388+
gpt_4_5_preview = custom_model("gpt-4.5-preview")
388389

389390

390391
class AnthropicModels:
@@ -687,7 +688,7 @@ async def stream_generator():
687688
return compressed_content, None
688689
except ValueError as e:
689690
return "", e
690-
691+
691692
# For non-JSON responses, keep original formatting but make single line
692693
logger.debug(f"[LLM] API Response: {' '.join(content.strip().splitlines())}")
693694
return content.strip(), None
@@ -727,12 +728,14 @@ async def wrapper(
727728
haiku_3_5 = custom_model("anthropic/claude-3.5-haiku")
728729
sonnet = custom_model("anthropic/claude-3-sonnet")
729730
sonnet_3_5 = custom_model("anthropic/claude-3.5-sonnet")
731+
sonnet_3_7 = custom_model("anthropic/claude-3.7-sonnet")
730732
opus = custom_model("anthropic/claude-3-opus")
731733
gpt_3_5_turbo = custom_model("openai/gpt-3.5-turbo")
732734
gpt_4_turbo = custom_model("openai/gpt-4-turbo")
733735
gpt_4 = custom_model("openai/gpt-4")
734736
gpt_4o = custom_model("openai/gpt-4o")
735737
gpt_4o_mini = custom_model("openai/gpt-4o-mini")
738+
gpt_4_5_preview = custom_model("openai/gpt-4.5-preview")
736739
o1_preview = custom_model("openai/o1-preview")
737740
o1_mini = custom_model("openai/o1-mini")
738741
gemini_flash_1_5 = custom_model("google/gemini-flash-1.5")
@@ -837,7 +840,7 @@ async def stream_generator():
837840
options={"temperature": temperature, "num_predict": max_tokens},
838841
stream=True,
839842
)
840-
843+
841844
for chunk in response:
842845
if chunk and "message" in chunk and "content" in chunk["message"]:
843846
content = chunk["message"]["content"]
@@ -1012,7 +1015,7 @@ async def stream_generator():
10121015
return compressed_content, None
10131016
except ValueError as e:
10141017
return "", e
1015-
1018+
10161019
# For non-JSON responses, keep original formatting but make single line
10171020
logger.debug(f"[LLM] API Response: {' '.join(content.strip().splitlines())}")
10181021
return content.strip(), None
@@ -1084,7 +1087,7 @@ async def send_together_request(
10841087
content = []
10851088
if isinstance(image_data, str):
10861089
image_data = [image_data]
1087-
1090+
10881091
for i, image in enumerate(image_data, start=1):
10891092
content.append({"type": "text", "text": f"Image {i}:"})
10901093
if image.startswith(("http://", "https://")):
@@ -1097,7 +1100,7 @@ async def send_together_request(
10971100
"type": "image_url",
10981101
"image_url": {"url": f"data:image/jpeg;base64,{image}"}
10991102
})
1100-
1103+
11011104
# Add original text content
11021105
content.append({"type": "text", "text": last_user_msg["content"]})
11031106
last_user_msg["content"] = content
@@ -1120,19 +1123,19 @@ async def stream_generator():
11201123
response_format={"type": "json_object"} if require_json_output else None,
11211124
stream=True
11221125
)
1123-
1126+
11241127
for chunk in response:
11251128
if chunk.choices[0].delta.content:
11261129
content = chunk.choices[0].delta.content
11271130
full_message += content
11281131
yield content
11291132
logger.debug("Stream complete")
11301133
logger.debug(f"Full message: {full_message}")
1131-
yield "\n"
1134+
yield "\n"
11321135
except Exception as e:
11331136
logger.error(f"An error occurred during streaming: {e}")
11341137
yield ""
1135-
yield "\n"
1138+
yield "\n"
11361139

11371140
return stream_generator()
11381141

@@ -1148,7 +1151,7 @@ async def stream_generator():
11481151

11491152
content = response.choices[0].message.content
11501153
spinner.succeed("Request completed")
1151-
1154+
11521155
# Compress the response to single line if it's JSON
11531156
if require_json_output:
11541157
try:
@@ -1158,7 +1161,7 @@ async def stream_generator():
11581161
return compressed_content, None
11591162
except ValueError as e:
11601163
return "", e
1161-
1164+
11621165
# For non-JSON responses, keep original formatting but make single line
11631166
logger.debug(f"[LLM] API Response: {' '.join(content.strip().splitlines())}")
11641167
return content.strip(), None
@@ -1216,7 +1219,7 @@ async def send_gemini_request(
12161219
"""
12171220
# Create spinner only once at the start
12181221
spinner = Halo(text=f"Sending request to Gemini ({model})...", spinner="dots")
1219-
1222+
12201223
try:
12211224
# Start spinner
12221225
spinner.start()
@@ -1229,7 +1232,7 @@ async def send_gemini_request(
12291232
"temperature": temperature,
12301233
"max_output_tokens": max_tokens,
12311234
}
1232-
1235+
12331236
if require_json_output:
12341237
generation_config.update({
12351238
"response_mime_type": "application/json"
@@ -1247,15 +1250,15 @@ async def send_gemini_request(
12471250
last_user_message = next((msg["content"] for msg in reversed(messages) if msg["role"] == "user"), "")
12481251
full_message = ""
12491252
logger.debug("Stream started")
1250-
1253+
12511254
try:
12521255
response = model_instance.generate_content(last_user_message, stream=True)
12531256
for chunk in response:
12541257
if chunk.text:
12551258
content = chunk.text
12561259
full_message += content
12571260
yield content
1258-
1261+
12591262
logger.debug("Stream complete")
12601263
logger.debug(f"Full message: {full_message}")
12611264
except Exception as e:
@@ -1264,13 +1267,13 @@ async def send_gemini_request(
12641267
else:
12651268
# Non-streaming: Use chat format
12661269
chat = model_instance.start_chat(history=[])
1267-
1270+
12681271
# Process messages and images
12691272
if messages:
12701273
for msg in messages:
12711274
role = msg["role"]
12721275
content = msg["content"]
1273-
1276+
12741277
if role == "user":
12751278
if image_data and msg == messages[-1]:
12761279
parts = []
@@ -1508,7 +1511,7 @@ async def stream_generator():
15081511
# Non-streaming logic
15091512
spinner.text = f"Waiting for {model} response..."
15101513
response = await client.chat.completions.create(**request_params)
1511-
1514+
15121515
if model == "deepseek-reasoner":
15131516
reasoning = response.choices[0].message.reasoning_content
15141517
content = response.choices[0].message.content
@@ -1564,7 +1567,7 @@ async def wrapper(
15641567
)
15651568

15661569
return wrapper
1567-
1570+
15681571
# Model-specific methods using custom_model
15691572
chat = custom_model("deepseek-chat")
15701573
reasoner = custom_model("deepseek-reasoner")

0 commit comments

Comments
 (0)