inferencesh 0.2.33__py3-none-any.whl → 0.2.35__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of inferencesh might be problematic. Click here for more details.

inferencesh/models/llm.py CHANGED
@@ -23,31 +23,27 @@ class Message(BaseAppInput):
23
23
 
24
24
  class ContextMessage(BaseAppInput):
25
25
  role: ContextMessageRole = Field(
26
- description="The role of the message",
26
+ description="the role of the message. user, assistant, or system",
27
27
  )
28
28
  text: str = Field(
29
- description="The text content of the message"
29
+ description="the text content of the message"
30
30
  )
31
31
  image: Optional[File] = Field(
32
- description="The image url of the message",
32
+ description="the image file of the message",
33
33
  default=None
34
34
  )
35
35
 
36
36
  class BaseLLMInput(BaseAppInput):
37
37
  """Base class with common LLM fields."""
38
38
  system_prompt: str = Field(
39
- description="The system prompt to use for the model",
40
- default="You are a helpful assistant that can answer questions and help with tasks.",
39
+ description="the system prompt to use for the model",
40
+ default="you are a helpful assistant that can answer questions and help with tasks.",
41
41
  examples=[
42
- "You are a helpful assistant that can answer questions and help with tasks.",
43
- "You are a certified medical professional who can provide accurate health information.",
44
- "You are a certified financial advisor who can give sound investment guidance.",
45
- "You are a certified cybersecurity expert who can explain security best practices.",
46
- "You are a certified environmental scientist who can discuss climate and sustainability.",
42
+ "you are a helpful assistant that can answer questions and help with tasks.",
47
43
  ]
48
44
  )
49
45
  context: List[ContextMessage] = Field(
50
- description="The context to use for the model",
46
+ description="the context to use for the model",
51
47
  default=[],
52
48
  examples=[
53
49
  [
@@ -57,37 +53,35 @@ class BaseLLMInput(BaseAppInput):
57
53
  ]
58
54
  )
59
55
  text: str = Field(
60
- description="The user prompt to use for the model",
56
+ description="the user prompt to use for the model",
61
57
  examples=[
62
- "What is the capital of France?",
63
- "What is the weather like today?",
64
- "Can you help me write a poem about spring?",
65
- "Explain quantum computing in simple terms"
58
+ "write a haiku about artificial general intelligence"
66
59
  ]
67
60
  )
68
- temperature: float = Field(default=0.7)
69
- top_p: float = Field(default=0.95)
70
- max_tokens: int = Field(default=4096)
61
+ temperature: float = Field(default=0.7, ge=0.0, le=1.0)
62
+ top_p: float = Field(default=0.95, ge=0.0, le=1.0)
71
63
  context_size: int = Field(default=4096)
72
64
 
73
65
  class ImageCapabilityMixin(BaseModel):
74
66
  """Mixin for models that support image inputs."""
75
67
  image: Optional[File] = Field(
76
- description="The image to use for the model",
77
- default=None
68
+ description="the image to use for the model",
69
+ default=None,
70
+ content_type=["image/*"],
71
+ max_size_mb=10
78
72
  )
79
73
 
80
74
  class ReasoningCapabilityMixin(BaseModel):
81
75
  """Mixin for models that support reasoning."""
82
76
  reasoning: bool = Field(
83
- description="Enable step-by-step reasoning",
77
+ description="enable step-by-step reasoning",
84
78
  default=False
85
79
  )
86
80
 
87
81
  class ToolsCapabilityMixin(BaseModel):
88
82
  """Mixin for models that support tool/function calling."""
89
83
  tools: Optional[List[Dict[str, Any]]] = Field(
90
- description="Tool definitions for function calling",
84
+ description="tool definitions for function calling",
91
85
  default=None
92
86
  )
93
87
 
@@ -112,26 +106,26 @@ class LLMUsage(BaseAppOutput):
112
106
 
113
107
  class BaseLLMOutput(BaseAppOutput):
114
108
  """Base class for LLM outputs with common fields."""
115
- response: str = Field(description="The generated text response")
109
+ response: str = Field(description="the generated text response")
116
110
 
117
111
  class LLMUsageMixin(BaseModel):
118
112
  """Mixin for models that provide token usage statistics."""
119
113
  usage: Optional[LLMUsage] = Field(
120
- description="Token usage statistics",
114
+ description="token usage statistics",
121
115
  default=None
122
116
  )
123
117
 
124
118
  class ReasoningMixin(BaseModel):
125
119
  """Mixin for models that support reasoning."""
126
120
  reasoning: Optional[str] = Field(
127
- description="The reasoning output of the model",
121
+ description="the reasoning output of the model",
128
122
  default=None
129
123
  )
130
124
 
131
125
  class ToolCallsMixin(BaseModel):
132
126
  """Mixin for models that support tool calls."""
133
127
  tool_calls: Optional[List[Dict[str, Any]]] = Field(
134
- description="Tool calls for function calling",
128
+ description="tool calls for function calling",
135
129
  default=None
136
130
  )
137
131
 
@@ -588,7 +582,6 @@ def stream_generate(
588
582
  tool_choice: Optional[Dict[str, Any]] = None,
589
583
  temperature: float = 0.7,
590
584
  top_p: float = 0.95,
591
- max_tokens: int = 4096,
592
585
  stop: Optional[List[str]] = None,
593
586
  verbose: bool = False,
594
587
  output_cls: type[BaseLLMOutput] = LLMOutput,
@@ -612,7 +605,6 @@ def stream_generate(
612
605
  "stream": True,
613
606
  "temperature": temperature,
614
607
  "top_p": top_p,
615
- "max_tokens": max_tokens,
616
608
  "stop": stop
617
609
  }
618
610
  if tools is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: inferencesh
3
- Version: 0.2.33
3
+ Version: 0.2.35
4
4
  Summary: inference.sh Python SDK
5
5
  Author: Inference Shell Inc.
6
6
  Author-email: "Inference Shell Inc." <hello@inference.sh>
@@ -2,13 +2,13 @@ inferencesh/__init__.py,sha256=WdADtOhfa3HDOunoE9HLFCTFlXRykYstBIH1FpyWvj8,613
2
2
  inferencesh/models/__init__.py,sha256=FDwcdtT6c4hbRitymjmN-hZMlQa8RbKSftkZZyjtUXA,536
3
3
  inferencesh/models/base.py,sha256=4gZQRi8J7y9U6PrGD9pRIehd1MJVJAqGakPQDs2AKFM,3251
4
4
  inferencesh/models/file.py,sha256=5xnpypcRahM1YcEjj64rv9g2gTimxrZb41YT4r440hU,7393
5
- inferencesh/models/llm.py,sha256=KTy9XAXQS_2p4HThyofSl4Nu8F87sA4IPJqmP233VA8,28304
5
+ inferencesh/models/llm.py,sha256=bOX9G8aM26bRcCyswhO6SjfkNFUuMhjeF9AaVjp6v4Q,27776
6
6
  inferencesh/utils/__init__.py,sha256=-xiD6uo2XzcrPAWFb_fUbaimmnW4KFKc-8IvBzaxNd4,148
7
7
  inferencesh/utils/download.py,sha256=7n5twvoNYDcFnKJyefImaj2YfzRI7vddQw4usZbj38c,1521
8
8
  inferencesh/utils/storage.py,sha256=E4J8emd4eFKdmdDgAqzz3TpaaDd3n0l8gYlMHuY8yIU,519
9
- inferencesh-0.2.33.dist-info/licenses/LICENSE,sha256=OsgqEWIh2el_QMj0y8O1A5Q5Dl-dxqqYbFE6fszuR4s,1086
10
- inferencesh-0.2.33.dist-info/METADATA,sha256=Thb63zVHWjix6fCnfOEn4FFwnWnZ_XXCUWGrwpnkeTk,2757
11
- inferencesh-0.2.33.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
- inferencesh-0.2.33.dist-info/entry_points.txt,sha256=6IC-fyozAqW3ljsMLGCXxJ0_ui2Jb-2fLHtoH1RTnEE,45
13
- inferencesh-0.2.33.dist-info/top_level.txt,sha256=TSMHg3T1ThMl1HGAWmzBClwOYH1ump5neof9BfHIwaA,12
14
- inferencesh-0.2.33.dist-info/RECORD,,
9
+ inferencesh-0.2.35.dist-info/licenses/LICENSE,sha256=OsgqEWIh2el_QMj0y8O1A5Q5Dl-dxqqYbFE6fszuR4s,1086
10
+ inferencesh-0.2.35.dist-info/METADATA,sha256=gZn4x4yvuNBOp7wAInJYBqwwVnOqFOpQQqKEDrul9VI,2757
11
+ inferencesh-0.2.35.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ inferencesh-0.2.35.dist-info/entry_points.txt,sha256=6IC-fyozAqW3ljsMLGCXxJ0_ui2Jb-2fLHtoH1RTnEE,45
13
+ inferencesh-0.2.35.dist-info/top_level.txt,sha256=TSMHg3T1ThMl1HGAWmzBClwOYH1ump5neof9BfHIwaA,12
14
+ inferencesh-0.2.35.dist-info/RECORD,,