OneLLM 0.0.6__tar.gz → 0.1.0__tar.gz

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.
Files changed (108) hide show
  1. {onellm-0.0.6 → onellm-0.1.0}/OneLLM.egg-info/PKG-INFO +99 -22
  2. onellm-0.1.0/OneLLM.egg-info/SOURCES.txt +56 -0
  3. onellm-0.0.6/README.md → onellm-0.1.0/PKG-INFO +122 -19
  4. onellm-0.0.6/PKG-INFO → onellm-0.1.0/README.md +66 -45
  5. onellm-0.1.0/onellm/.version +1 -0
  6. onellm-0.1.0/onellm/cli/__init__.py +41 -0
  7. onellm-0.1.0/onellm/cli/download_model.py +133 -0
  8. {onellm-0.0.6 → onellm-0.1.0}/onellm/config.py +126 -6
  9. {onellm-0.0.6 → onellm-0.1.0}/onellm/models.py +52 -1
  10. onellm-0.1.0/onellm/providers/__init__.py +101 -0
  11. onellm-0.1.0/onellm/providers/anthropic.py +789 -0
  12. onellm-0.1.0/onellm/providers/anyscale.py +138 -0
  13. onellm-0.1.0/onellm/providers/azure.py +1135 -0
  14. onellm-0.1.0/onellm/providers/bedrock.py +791 -0
  15. onellm-0.1.0/onellm/providers/cohere.py +635 -0
  16. onellm-0.1.0/onellm/providers/deepseek.py +60 -0
  17. onellm-0.1.0/onellm/providers/fireworks.py +59 -0
  18. onellm-0.1.0/onellm/providers/google.py +619 -0
  19. onellm-0.1.0/onellm/providers/groq.py +85 -0
  20. onellm-0.1.0/onellm/providers/llama_cpp.py +610 -0
  21. onellm-0.1.0/onellm/providers/mistral.py +712 -0
  22. onellm-0.1.0/onellm/providers/ollama.py +312 -0
  23. {onellm-0.0.6 → onellm-0.1.0}/onellm/providers/openai.py +6 -5
  24. onellm-0.1.0/onellm/providers/openai_compatible.py +132 -0
  25. onellm-0.1.0/onellm/providers/openrouter.py +76 -0
  26. onellm-0.1.0/onellm/providers/perplexity.py +63 -0
  27. onellm-0.1.0/onellm/providers/together.py +59 -0
  28. onellm-0.1.0/onellm/providers/vertexai.py +697 -0
  29. onellm-0.1.0/onellm/providers/xai.py +59 -0
  30. {onellm-0.0.6 → onellm-0.1.0}/onellm/utils/__init__.py +8 -4
  31. onellm-0.1.0/onellm/utils/text_cleaner.py +137 -0
  32. {onellm-0.0.6 → onellm-0.1.0}/pyproject.toml +41 -8
  33. {onellm-0.0.6 → onellm-0.1.0}/setup.py +27 -4
  34. onellm-0.0.6/OneLLM.egg-info/SOURCES.txt +0 -82
  35. onellm-0.0.6/onellm/.version +0 -1
  36. onellm-0.0.6/onellm/providers/__init__.py +0 -48
  37. onellm-0.0.6/tests/test_audio.py +0 -222
  38. onellm-0.0.6/tests/test_audio_advanced.py +0 -226
  39. onellm-0.0.6/tests/test_chat_completion_advanced.py +0 -227
  40. onellm-0.0.6/tests/test_client_interface.py +0 -719
  41. onellm-0.0.6/tests/test_combined_coverage.py +0 -318
  42. onellm-0.0.6/tests/test_completion_advanced.py +0 -219
  43. onellm-0.0.6/tests/test_completion_final.py +0 -186
  44. onellm-0.0.6/tests/test_config.py +0 -124
  45. onellm-0.0.6/tests/test_config_full_coverage.py +0 -103
  46. onellm-0.0.6/tests/test_embedding_full_coverage.py +0 -302
  47. onellm-0.0.6/tests/test_fallback.py +0 -218
  48. onellm-0.0.6/tests/test_fallback_100_percent.py +0 -522
  49. onellm-0.0.6/tests/test_fallback_provider_enhanced.py +0 -629
  50. onellm-0.0.6/tests/test_fallback_utils_coverage.py +0 -83
  51. onellm-0.0.6/tests/test_file_operations_parent_creation.py +0 -77
  52. onellm-0.0.6/tests/test_files_full_coverage.py +0 -331
  53. onellm-0.0.6/tests/test_image.py +0 -231
  54. onellm-0.0.6/tests/test_image_coverage_improved.py +0 -387
  55. onellm-0.0.6/tests/test_json_decode_error.py +0 -48
  56. onellm-0.0.6/tests/test_json_decode_targeted.py +0 -78
  57. onellm-0.0.6/tests/test_json_mode.py +0 -174
  58. onellm-0.0.6/tests/test_json_stream_coverage.py +0 -118
  59. onellm-0.0.6/tests/test_json_stream_custom.py +0 -155
  60. onellm-0.0.6/tests/test_openai_additional_coverage.py +0 -299
  61. onellm-0.0.6/tests/test_openai_additional_lines.py +0 -274
  62. onellm-0.0.6/tests/test_openai_error_handling.py +0 -259
  63. onellm-0.0.6/tests/test_openai_file_operations.py +0 -187
  64. onellm-0.0.6/tests/test_openai_file_upload.py +0 -194
  65. onellm-0.0.6/tests/test_openai_provider.py +0 -292
  66. onellm-0.0.6/tests/test_openai_provider_complete_coverage.py +0 -468
  67. onellm-0.0.6/tests/test_openai_provider_expanded_coverage.py +0 -291
  68. onellm-0.0.6/tests/test_openai_streaming_and_tools.py +0 -690
  69. onellm-0.0.6/tests/test_pragmas.py +0 -53
  70. onellm-0.0.6/tests/test_provider_base_complete_coverage.py +0 -334
  71. onellm-0.0.6/tests/test_provider_capabilities.py +0 -267
  72. onellm-0.0.6/tests/test_provider_upload_file.py +0 -295
  73. onellm-0.0.6/tests/test_retries.py +0 -165
  74. onellm-0.0.6/tests/test_retry_improved.py +0 -165
  75. onellm-0.0.6/tests/test_speech.py +0 -180
  76. onellm-0.0.6/tests/test_speech_additional.py +0 -171
  77. onellm-0.0.6/tests/test_stream_timeout.py +0 -119
  78. onellm-0.0.6/tests/test_streaming.py +0 -391
  79. onellm-0.0.6/tests/test_streaming_coverage_improved.py +0 -534
  80. onellm-0.0.6/tests/test_token_counter.py +0 -165
  81. onellm-0.0.6/tests/test_token_counter_full_coverage.py +0 -275
  82. onellm-0.0.6/tests/test_validators.py +0 -410
  83. onellm-0.0.6/tests/test_vision.py +0 -201
  84. {onellm-0.0.6 → onellm-0.1.0}/LICENSE +0 -0
  85. {onellm-0.0.6 → onellm-0.1.0}/MANIFEST.in +0 -0
  86. {onellm-0.0.6 → onellm-0.1.0}/OneLLM.egg-info/dependency_links.txt +0 -0
  87. {onellm-0.0.6 → onellm-0.1.0}/OneLLM.egg-info/top_level.txt +0 -0
  88. {onellm-0.0.6 → onellm-0.1.0}/onellm/__init__.py +0 -0
  89. {onellm-0.0.6 → onellm-0.1.0}/onellm/audio.py +0 -0
  90. {onellm-0.0.6 → onellm-0.1.0}/onellm/chat_completion.py +0 -0
  91. {onellm-0.0.6 → onellm-0.1.0}/onellm/client.py +0 -0
  92. {onellm-0.0.6 → onellm-0.1.0}/onellm/completion.py +0 -0
  93. {onellm-0.0.6 → onellm-0.1.0}/onellm/embedding.py +0 -0
  94. {onellm-0.0.6 → onellm-0.1.0}/onellm/errors.py +0 -0
  95. {onellm-0.0.6 → onellm-0.1.0}/onellm/files.py +0 -0
  96. {onellm-0.0.6 → onellm-0.1.0}/onellm/image.py +0 -0
  97. {onellm-0.0.6 → onellm-0.1.0}/onellm/providers/base.py +0 -0
  98. {onellm-0.0.6 → onellm-0.1.0}/onellm/providers/fallback.py +0 -0
  99. {onellm-0.0.6 → onellm-0.1.0}/onellm/speech.py +0 -0
  100. {onellm-0.0.6 → onellm-0.1.0}/onellm/types/__init__.py +0 -0
  101. {onellm-0.0.6 → onellm-0.1.0}/onellm/types/common.py +0 -0
  102. {onellm-0.0.6 → onellm-0.1.0}/onellm/utils/fallback.py +0 -0
  103. {onellm-0.0.6 → onellm-0.1.0}/onellm/utils/retry.py +0 -0
  104. {onellm-0.0.6 → onellm-0.1.0}/onellm/utils/streaming.py +0 -0
  105. {onellm-0.0.6 → onellm-0.1.0}/onellm/utils/token_counter.py +0 -0
  106. {onellm-0.0.6 → onellm-0.1.0}/onellm/validators.py +0 -0
  107. {onellm-0.0.6 → onellm-0.1.0}/setup.cfg +0 -0
  108. {onellm-0.0.6 → onellm-0.1.0}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: onellm
3
- Version: 0.0.6
3
+ Version: 0.1.0
4
4
  Summary: A unified interface for interacting with large language models from various providers - a complete drop-in replacement for OpenAI's client
5
5
  Home-page: https://github.com/muxi-ai/onellm
6
6
  Author: Ran Aroussi
@@ -9,9 +9,9 @@ License: Apache-2.0
9
9
  Project-URL: Homepage, https://github.com/muxi-ai/onellm
10
10
  Project-URL: Documentation, https://docs.muxi.io
11
11
  Project-URL: Issues, https://github.com/muxi-ai/onellm/issues
12
- Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Intended Audience :: Developers
14
- Classifier: License :: OSI Approved :: GNU Affero General Public License v3
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: Programming Language :: Python :: 3
16
16
  Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: Programming Language :: Python :: 3.11
@@ -19,6 +19,36 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
19
  Requires-Python: >=3.10
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE
22
+ Requires-Dist: requests>=2.25.0
23
+ Requires-Dist: aiohttp>=3.8.0
24
+ Requires-Dist: pydantic>=1.8.0
25
+ Requires-Dist: PyYAML>=6.0.0
26
+ Requires-Dist: openai>=1.0.0
27
+ Requires-Dist: tiktoken>=0.3.0
28
+ Requires-Dist: huggingface-hub>=0.19.0
29
+ Provides-Extra: all
30
+ Requires-Dist: anthropic>=0.5.0; extra == "all"
31
+ Requires-Dist: google-generativeai>=0.3.0; extra == "all"
32
+ Requires-Dist: boto3>=1.26.0; extra == "all"
33
+ Requires-Dist: llama-cpp-python>=0.2.0; extra == "all"
34
+ Requires-Dist: google-auth>=2.16.0; extra == "all"
35
+ Requires-Dist: google-cloud-aiplatform>=1.38.0; extra == "all"
36
+ Provides-Extra: bedrock
37
+ Requires-Dist: boto3>=1.26.0; extra == "bedrock"
38
+ Provides-Extra: vertexai
39
+ Requires-Dist: google-auth>=2.16.0; extra == "vertexai"
40
+ Requires-Dist: google-cloud-aiplatform>=1.38.0; extra == "vertexai"
41
+ Provides-Extra: llama
42
+ Requires-Dist: llama-cpp-python>=0.2.0; extra == "llama"
43
+ Provides-Extra: dev
44
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
45
+ Requires-Dist: pytest-asyncio>=0.18.0; extra == "dev"
46
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
47
+ Requires-Dist: black>=22.0.0; extra == "dev"
48
+ Requires-Dist: isort>=5.10.0; extra == "dev"
49
+ Requires-Dist: mypy>=0.950; extra == "dev"
50
+ Requires-Dist: ruff>=0.0.100; extra == "dev"
51
+ Requires-Dist: python-dotenv>=0.19.0; extra == "dev"
22
52
  Dynamic: author
23
53
  Dynamic: home-page
24
54
  Dynamic: license-file
@@ -34,16 +64,16 @@ Dynamic: requires-python
34
64
   
35
65
  [![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](./CONTRIBUTING.md)
36
66
 
37
- ### A "drop-in replacement" for OpenAI's client that offers a unified interface for interacting with large language models from various providers, with support for hundreds of models, built-in fallback mechanisms, and enhanced reliability features.
67
+ ### A "drop-in" replacement for OpenAI's client that offers a unified interface for interacting with large language models from various providers, with support for hundreds of models, built-in fallback mechanisms, and enhanced reliability features.
38
68
 
39
69
  ---
40
70
 
41
- > [!TIP]
71
+ > [!IMPORTANT]
42
72
  > #### Support this project by starring this repo on GitHub!
43
73
  >
44
74
  > More stars → more visibility → more contributors → better features → more robust tool for everyone 🎉
45
75
  >
46
- > <a href="https://github.com/muxi-ai/onellm" target="_blank"><img src="https://img.shields.io/github/stars/ranaroussi/onellm.svg?style=social&label=Star&maxAge=60" alt="Star this repo"></a>
76
+ > [🌟 Star this repo on GitHub →](https://github.com/muxi-ai/onellm)
47
77
  >
48
78
  > Thank you for your support! 🙏
49
79
 
@@ -74,10 +104,10 @@ Dynamic: requires-python
74
104
 
75
105
  The library follows the OpenAI client API design pattern, making it familiar to developers already using OpenAI and enabling easy migration for existing applications. **Simply change your import statements and instantly gain access to hundreds of models** across dozens of providers while maintaining your existing code structure.
76
106
 
77
- With support for 25+ providers, OneLLM gives you access to approximately 300+ unique language models through a single, consistent interface - from the latest proprietary models to open-source alternatives, all accessible through familiar OpenAI-compatible patterns.
107
+ With support for 18 implemented providers (and more planned), OneLLM gives you access to approximately 300+ unique language models through a single, consistent interface - from the latest proprietary models to open-source alternatives, all accessible through familiar OpenAI-compatible patterns.
78
108
 
79
109
  > [!NOTE]
80
- > **Work in Progress**: OneLLM is currently under active development. The full functionality has been achieved using OpenAI, and I'm now working on adding support for more providers. [Contributions are welcome](./CONTRIBUTING.md) to help expand provider support!
110
+ > **Ready for Use**: OneLLM now supports 18 providers with 300+ models! From cloud APIs to local models, you can access them all through a single, unified interface. [Contributions are welcome](./CONTRIBUTING.md) to help add even more providers!
81
111
 
82
112
  ---
83
113
 
@@ -86,13 +116,25 @@ With support for 25+ providers, OneLLM gives you access to approximately 300+ un
86
116
  ### Installation
87
117
 
88
118
  ```bash
89
- # Basic installation (includes OpenAI compatibility)
119
+ # Basic installation (includes OpenAI compatibility and download utility)
90
120
  pip install OneLLM
91
121
 
92
122
  # For all providers (includes dependencies for future provider support)
93
123
  pip install "OneLLM[all]"
94
124
  ```
95
125
 
126
+ ### Download Models for Local Use
127
+
128
+ OneLLM includes a built-in utility for downloading GGUF models:
129
+
130
+ ```bash
131
+ # Download a model from HuggingFace (saves to ~/llama_models by default)
132
+ onellm download --repo-id "TheBloke/Llama-2-7B-GGUF" --filename "llama-2-7b.Q4_K_M.gguf"
133
+
134
+ # Download to a custom directory
135
+ onellm download -r "microsoft/Phi-3-mini-4k-instruct-gguf" -f "Phi-3-mini-4k-instruct-q4.gguf" -o /path/to/models
136
+ ```
137
+
96
138
  ### Quick Win: Your First LLM Call
97
139
 
98
140
  ```python
@@ -121,13 +163,15 @@ For more detailed examples, check out the [examples directory](./examples).
121
163
  | Feature | Description |
122
164
  |---------|-------------|
123
165
  | **📦 Drop-in replacement** | Use your existing OpenAI code with minimal changes |
124
- | **🔄 Provider-agnostic** | Support for 300+ models across 25+ LLM providers |
166
+ | **🔄 Provider-agnostic** | Support for 300+ models across 18 implemented providers |
125
167
  | **🔁 Automatic fallback** | Seamlessly switch to alternative models when needed |
126
168
  | **🔄 Auto-retry mechanism** | Retry the same model multiple times before failing |
127
169
  | **🧩 OpenAI-compatible** | Familiar interface for developers used to OpenAI |
128
170
  | **📺 Streaming support** | Real-time streaming responses from supported providers |
129
171
  | **🖼️ Multi-modal capabilities** | Support for text, images, audio across compatible models |
130
- | **🖼️ Local LLM support** | Support for local LLMs via Ollama and llama.cpp |
172
+ | **🏠 Local LLM support** | Run models locally via Ollama and llama.cpp |
173
+ | **⬇️ Model downloads** | Built-in CLI to download GGUF models from HuggingFace |
174
+ | **🧹 Unicode artifact cleaning** | Automatic removal of invisible characters to prevent AI detection |
131
175
  | **🏷️ Consistent naming** | Clear `provider/model-name` format for attribution |
132
176
  | **🧪 Comprehensive tests** | 96% test coverage ensuring reliability |
133
177
  | **📄 Apache-2.0 license** | Open-source license that protects contributions |
@@ -136,11 +180,29 @@ For more detailed examples, check out the [examples directory](./examples).
136
180
 
137
181
  ## 🌐 Supported Providers
138
182
 
139
- OneLLM supports models through three main approaches:
140
-
141
- 1. **Direct integration with provider APIs**
142
- 2. **OpenRouter connectivity for aggregated access**
143
- 3. **Local model support via Ollama and llama.cpp**
183
+ OneLLM currently supports **18 providers** with more on the way:
184
+
185
+ ### Cloud API Providers (16)
186
+ - **Anthropic** - Claude family of models
187
+ - **Anyscale** - Configurable AI platform
188
+ - **AWS Bedrock** - Access to multiple model families
189
+ - **Azure OpenAI** - Microsoft-hosted OpenAI models
190
+ - **Cohere** - Command models with RAG
191
+ - **DeepSeek** - Chinese LLM provider
192
+ - **Fireworks** - Fast inference platform
193
+ - **Google AI Studio** - Gemini models via API key
194
+ - **Groq** - Ultra-fast inference for Llama, Mixtral
195
+ - **Mistral** - Mistral Large, Medium, Small
196
+ - **OpenAI** - GPT-4o, 3o-mini, DALL-E, Whisper, etc.
197
+ - **OpenRouter** - Gateway to 100+ models
198
+ - **Perplexity** - Search-augmented models
199
+ - **Together AI** - Open-source model hosting
200
+ - **Vertex AI** - Google Cloud's enterprise Gemini
201
+ - **X.AI** - Grok models
202
+
203
+ ### Local Providers (2)
204
+ - **Ollama** - Run models locally with easy management
205
+ - **llama.cpp** - Direct GGUF model execution
144
206
 
145
207
  ### Notable Models Available
146
208
 
@@ -673,14 +735,29 @@ Models are specified using a provider prefix to clearly identify the source:
673
735
  <td><code>mistral/mistral-large</code></td>
674
736
  </tr>
675
737
  <tr>
676
- <td>Local via Ollama</td>
677
- <td><code>ollama/{model}</code></td>
678
- <td><code>ollama/llama3</code></td>
738
+ <td>Ollama</td>
739
+ <td><code>ollama/{model}@host:port</code></td>
740
+ <td><code>ollama/llama3:8b@localhost:11434</code></td>
741
+ </tr>
742
+ <tr>
743
+ <td>llama.cpp</td>
744
+ <td><code>llama_cpp/{model.gguf}</code></td>
745
+ <td><code>llama_cpp/llama-3-8b-q4_K_M.gguf</code></td>
746
+ </tr>
747
+ <tr>
748
+ <td>XAI (Grok)</td>
749
+ <td><code>xai/{model}</code></td>
750
+ <td><code>xai/grok-beta</code></td>
751
+ </tr>
752
+ <tr>
753
+ <td>Cohere</td>
754
+ <td><code>cohere/{model}</code></td>
755
+ <td><code>cohere/command-r-plus</code></td>
679
756
  </tr>
680
757
  <tr>
681
- <td>Via OpenRouter</td>
682
- <td><code>openrouter/{provider}/{model}</code></td>
683
- <td><code>openrouter/anthropic/claude-3</code></td>
758
+ <td>AWS Bedrock</td>
759
+ <td><code>bedrock/{model}</code></td>
760
+ <td><code>bedrock/claude-3-5-sonnet</code></td>
684
761
  </tr>
685
762
  </table>
686
763
 
@@ -0,0 +1,56 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ setup.py
6
+ OneLLM.egg-info/PKG-INFO
7
+ OneLLM.egg-info/SOURCES.txt
8
+ OneLLM.egg-info/dependency_links.txt
9
+ OneLLM.egg-info/top_level.txt
10
+ onellm/.version
11
+ onellm/__init__.py
12
+ onellm/audio.py
13
+ onellm/chat_completion.py
14
+ onellm/client.py
15
+ onellm/completion.py
16
+ onellm/config.py
17
+ onellm/embedding.py
18
+ onellm/errors.py
19
+ onellm/files.py
20
+ onellm/image.py
21
+ onellm/models.py
22
+ onellm/speech.py
23
+ onellm/validators.py
24
+ onellm/cli/__init__.py
25
+ onellm/cli/download_model.py
26
+ onellm/providers/__init__.py
27
+ onellm/providers/anthropic.py
28
+ onellm/providers/anyscale.py
29
+ onellm/providers/azure.py
30
+ onellm/providers/base.py
31
+ onellm/providers/bedrock.py
32
+ onellm/providers/cohere.py
33
+ onellm/providers/deepseek.py
34
+ onellm/providers/fallback.py
35
+ onellm/providers/fireworks.py
36
+ onellm/providers/google.py
37
+ onellm/providers/groq.py
38
+ onellm/providers/llama_cpp.py
39
+ onellm/providers/mistral.py
40
+ onellm/providers/ollama.py
41
+ onellm/providers/openai.py
42
+ onellm/providers/openai_compatible.py
43
+ onellm/providers/openrouter.py
44
+ onellm/providers/perplexity.py
45
+ onellm/providers/together.py
46
+ onellm/providers/vertexai.py
47
+ onellm/providers/xai.py
48
+ onellm/types/__init__.py
49
+ onellm/types/common.py
50
+ onellm/utils/__init__.py
51
+ onellm/utils/fallback.py
52
+ onellm/utils/retry.py
53
+ onellm/utils/streaming.py
54
+ onellm/utils/text_cleaner.py
55
+ onellm/utils/token_counter.py
56
+ tests/test_utils.py
@@ -1,3 +1,59 @@
1
+ Metadata-Version: 2.4
2
+ Name: onellm
3
+ Version: 0.1.0
4
+ Summary: A unified interface for interacting with large language models from various providers - a complete drop-in replacement for OpenAI's client
5
+ Home-page: https://github.com/muxi-ai/onellm
6
+ Author: Ran Aroussi
7
+ Author-email: Ran Aroussi <ran@aroussi.com>
8
+ License: Apache-2.0
9
+ Project-URL: Homepage, https://github.com/muxi-ai/onellm
10
+ Project-URL: Documentation, https://docs.muxi.io
11
+ Project-URL: Issues, https://github.com/muxi-ai/onellm/issues
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: requests>=2.25.0
23
+ Requires-Dist: aiohttp>=3.8.0
24
+ Requires-Dist: pydantic>=1.8.0
25
+ Requires-Dist: PyYAML>=6.0.0
26
+ Requires-Dist: openai>=1.0.0
27
+ Requires-Dist: tiktoken>=0.3.0
28
+ Requires-Dist: huggingface-hub>=0.19.0
29
+ Provides-Extra: all
30
+ Requires-Dist: anthropic>=0.5.0; extra == "all"
31
+ Requires-Dist: google-generativeai>=0.3.0; extra == "all"
32
+ Requires-Dist: boto3>=1.26.0; extra == "all"
33
+ Requires-Dist: llama-cpp-python>=0.2.0; extra == "all"
34
+ Requires-Dist: google-auth>=2.16.0; extra == "all"
35
+ Requires-Dist: google-cloud-aiplatform>=1.38.0; extra == "all"
36
+ Provides-Extra: bedrock
37
+ Requires-Dist: boto3>=1.26.0; extra == "bedrock"
38
+ Provides-Extra: vertexai
39
+ Requires-Dist: google-auth>=2.16.0; extra == "vertexai"
40
+ Requires-Dist: google-cloud-aiplatform>=1.38.0; extra == "vertexai"
41
+ Provides-Extra: llama
42
+ Requires-Dist: llama-cpp-python>=0.2.0; extra == "llama"
43
+ Provides-Extra: dev
44
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
45
+ Requires-Dist: pytest-asyncio>=0.18.0; extra == "dev"
46
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
47
+ Requires-Dist: black>=22.0.0; extra == "dev"
48
+ Requires-Dist: isort>=5.10.0; extra == "dev"
49
+ Requires-Dist: mypy>=0.950; extra == "dev"
50
+ Requires-Dist: ruff>=0.0.100; extra == "dev"
51
+ Requires-Dist: python-dotenv>=0.19.0; extra == "dev"
52
+ Dynamic: author
53
+ Dynamic: home-page
54
+ Dynamic: license-file
55
+ Dynamic: requires-python
56
+
1
57
  # OneLLM
2
58
 
3
59
  [![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://pypi.python.org/pypi/onellm)
@@ -8,16 +64,16 @@
8
64
  &nbsp;
9
65
  [![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](./CONTRIBUTING.md)
10
66
 
11
- ### A "drop-in replacement" for OpenAI's client that offers a unified interface for interacting with large language models from various providers, with support for hundreds of models, built-in fallback mechanisms, and enhanced reliability features.
67
+ ### A "drop-in" replacement for OpenAI's client that offers a unified interface for interacting with large language models from various providers, with support for hundreds of models, built-in fallback mechanisms, and enhanced reliability features.
12
68
 
13
69
  ---
14
70
 
15
- > [!TIP]
71
+ > [!IMPORTANT]
16
72
  > #### Support this project by starring this repo on GitHub!
17
73
  >
18
74
  > More stars → more visibility → more contributors → better features → more robust tool for everyone 🎉
19
75
  >
20
- > <a href="https://github.com/muxi-ai/onellm" target="_blank"><img src="https://img.shields.io/github/stars/ranaroussi/onellm.svg?style=social&label=Star&maxAge=60" alt="Star this repo"></a>
76
+ > [🌟 Star this repo on GitHub →](https://github.com/muxi-ai/onellm)
21
77
  >
22
78
  > Thank you for your support! 🙏
23
79
 
@@ -48,10 +104,10 @@
48
104
 
49
105
  The library follows the OpenAI client API design pattern, making it familiar to developers already using OpenAI and enabling easy migration for existing applications. **Simply change your import statements and instantly gain access to hundreds of models** across dozens of providers while maintaining your existing code structure.
50
106
 
51
- With support for 25+ providers, OneLLM gives you access to approximately 300+ unique language models through a single, consistent interface - from the latest proprietary models to open-source alternatives, all accessible through familiar OpenAI-compatible patterns.
107
+ With support for 18 implemented providers (and more planned), OneLLM gives you access to approximately 300+ unique language models through a single, consistent interface - from the latest proprietary models to open-source alternatives, all accessible through familiar OpenAI-compatible patterns.
52
108
 
53
109
  > [!NOTE]
54
- > **Work in Progress**: OneLLM is currently under active development. The full functionality has been achieved using OpenAI, and I'm now working on adding support for more providers. [Contributions are welcome](./CONTRIBUTING.md) to help expand provider support!
110
+ > **Ready for Use**: OneLLM now supports 18 providers with 300+ models! From cloud APIs to local models, you can access them all through a single, unified interface. [Contributions are welcome](./CONTRIBUTING.md) to help add even more providers!
55
111
 
56
112
  ---
57
113
 
@@ -60,13 +116,25 @@ With support for 25+ providers, OneLLM gives you access to approximately 300+ un
60
116
  ### Installation
61
117
 
62
118
  ```bash
63
- # Basic installation (includes OpenAI compatibility)
119
+ # Basic installation (includes OpenAI compatibility and download utility)
64
120
  pip install OneLLM
65
121
 
66
122
  # For all providers (includes dependencies for future provider support)
67
123
  pip install "OneLLM[all]"
68
124
  ```
69
125
 
126
+ ### Download Models for Local Use
127
+
128
+ OneLLM includes a built-in utility for downloading GGUF models:
129
+
130
+ ```bash
131
+ # Download a model from HuggingFace (saves to ~/llama_models by default)
132
+ onellm download --repo-id "TheBloke/Llama-2-7B-GGUF" --filename "llama-2-7b.Q4_K_M.gguf"
133
+
134
+ # Download to a custom directory
135
+ onellm download -r "microsoft/Phi-3-mini-4k-instruct-gguf" -f "Phi-3-mini-4k-instruct-q4.gguf" -o /path/to/models
136
+ ```
137
+
70
138
  ### Quick Win: Your First LLM Call
71
139
 
72
140
  ```python
@@ -95,13 +163,15 @@ For more detailed examples, check out the [examples directory](./examples).
95
163
  | Feature | Description |
96
164
  |---------|-------------|
97
165
  | **📦 Drop-in replacement** | Use your existing OpenAI code with minimal changes |
98
- | **🔄 Provider-agnostic** | Support for 300+ models across 25+ LLM providers |
166
+ | **🔄 Provider-agnostic** | Support for 300+ models across 18 implemented providers |
99
167
  | **🔁 Automatic fallback** | Seamlessly switch to alternative models when needed |
100
168
  | **🔄 Auto-retry mechanism** | Retry the same model multiple times before failing |
101
169
  | **🧩 OpenAI-compatible** | Familiar interface for developers used to OpenAI |
102
170
  | **📺 Streaming support** | Real-time streaming responses from supported providers |
103
171
  | **🖼️ Multi-modal capabilities** | Support for text, images, audio across compatible models |
104
- | **🖼️ Local LLM support** | Support for local LLMs via Ollama and llama.cpp |
172
+ | **🏠 Local LLM support** | Run models locally via Ollama and llama.cpp |
173
+ | **⬇️ Model downloads** | Built-in CLI to download GGUF models from HuggingFace |
174
+ | **🧹 Unicode artifact cleaning** | Automatic removal of invisible characters to prevent AI detection |
105
175
  | **🏷️ Consistent naming** | Clear `provider/model-name` format for attribution |
106
176
  | **🧪 Comprehensive tests** | 96% test coverage ensuring reliability |
107
177
  | **📄 Apache-2.0 license** | Open-source license that protects contributions |
@@ -110,11 +180,29 @@ For more detailed examples, check out the [examples directory](./examples).
110
180
 
111
181
  ## 🌐 Supported Providers
112
182
 
113
- OneLLM supports models through three main approaches:
114
-
115
- 1. **Direct integration with provider APIs**
116
- 2. **OpenRouter connectivity for aggregated access**
117
- 3. **Local model support via Ollama and llama.cpp**
183
+ OneLLM currently supports **18 providers** with more on the way:
184
+
185
+ ### Cloud API Providers (16)
186
+ - **Anthropic** - Claude family of models
187
+ - **Anyscale** - Configurable AI platform
188
+ - **AWS Bedrock** - Access to multiple model families
189
+ - **Azure OpenAI** - Microsoft-hosted OpenAI models
190
+ - **Cohere** - Command models with RAG
191
+ - **DeepSeek** - Chinese LLM provider
192
+ - **Fireworks** - Fast inference platform
193
+ - **Google AI Studio** - Gemini models via API key
194
+ - **Groq** - Ultra-fast inference for Llama, Mixtral
195
+ - **Mistral** - Mistral Large, Medium, Small
196
+ - **OpenAI** - GPT-4o, 3o-mini, DALL-E, Whisper, etc.
197
+ - **OpenRouter** - Gateway to 100+ models
198
+ - **Perplexity** - Search-augmented models
199
+ - **Together AI** - Open-source model hosting
200
+ - **Vertex AI** - Google Cloud's enterprise Gemini
201
+ - **X.AI** - Grok models
202
+
203
+ ### Local Providers (2)
204
+ - **Ollama** - Run models locally with easy management
205
+ - **llama.cpp** - Direct GGUF model execution
118
206
 
119
207
  ### Notable Models Available
120
208
 
@@ -647,14 +735,29 @@ Models are specified using a provider prefix to clearly identify the source:
647
735
  <td><code>mistral/mistral-large</code></td>
648
736
  </tr>
649
737
  <tr>
650
- <td>Local via Ollama</td>
651
- <td><code>ollama/{model}</code></td>
652
- <td><code>ollama/llama3</code></td>
738
+ <td>Ollama</td>
739
+ <td><code>ollama/{model}@host:port</code></td>
740
+ <td><code>ollama/llama3:8b@localhost:11434</code></td>
741
+ </tr>
742
+ <tr>
743
+ <td>llama.cpp</td>
744
+ <td><code>llama_cpp/{model.gguf}</code></td>
745
+ <td><code>llama_cpp/llama-3-8b-q4_K_M.gguf</code></td>
746
+ </tr>
747
+ <tr>
748
+ <td>XAI (Grok)</td>
749
+ <td><code>xai/{model}</code></td>
750
+ <td><code>xai/grok-beta</code></td>
751
+ </tr>
752
+ <tr>
753
+ <td>Cohere</td>
754
+ <td><code>cohere/{model}</code></td>
755
+ <td><code>cohere/command-r-plus</code></td>
653
756
  </tr>
654
757
  <tr>
655
- <td>Via OpenRouter</td>
656
- <td><code>openrouter/{provider}/{model}</code></td>
657
- <td><code>openrouter/anthropic/claude-3</code></td>
758
+ <td>AWS Bedrock</td>
759
+ <td><code>bedrock/{model}</code></td>
760
+ <td><code>bedrock/claude-3-5-sonnet</code></td>
658
761
  </tr>
659
762
  </table>
660
763
 
@@ -1,29 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: onellm
3
- Version: 0.0.6
4
- Summary: A unified interface for interacting with large language models from various providers - a complete drop-in replacement for OpenAI's client
5
- Home-page: https://github.com/muxi-ai/onellm
6
- Author: Ran Aroussi
7
- Author-email: Ran Aroussi <ran@aroussi.com>
8
- License: Apache-2.0
9
- Project-URL: Homepage, https://github.com/muxi-ai/onellm
10
- Project-URL: Documentation, https://docs.muxi.io
11
- Project-URL: Issues, https://github.com/muxi-ai/onellm/issues
12
- Classifier: Development Status :: 3 - Alpha
13
- Classifier: Intended Audience :: Developers
14
- Classifier: License :: OSI Approved :: GNU Affero General Public License v3
15
- Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.10
17
- Classifier: Programming Language :: Python :: 3.11
18
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
- Requires-Python: >=3.10
20
- Description-Content-Type: text/markdown
21
- License-File: LICENSE
22
- Dynamic: author
23
- Dynamic: home-page
24
- Dynamic: license-file
25
- Dynamic: requires-python
26
-
27
1
  # OneLLM
28
2
 
29
3
  [![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://pypi.python.org/pypi/onellm)
@@ -34,16 +8,16 @@ Dynamic: requires-python
34
8
  &nbsp;
35
9
  [![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](./CONTRIBUTING.md)
36
10
 
37
- ### A "drop-in replacement" for OpenAI's client that offers a unified interface for interacting with large language models from various providers, with support for hundreds of models, built-in fallback mechanisms, and enhanced reliability features.
11
+ ### A "drop-in" replacement for OpenAI's client that offers a unified interface for interacting with large language models from various providers, with support for hundreds of models, built-in fallback mechanisms, and enhanced reliability features.
38
12
 
39
13
  ---
40
14
 
41
- > [!TIP]
15
+ > [!IMPORTANT]
42
16
  > #### Support this project by starring this repo on GitHub!
43
17
  >
44
18
  > More stars → more visibility → more contributors → better features → more robust tool for everyone 🎉
45
19
  >
46
- > <a href="https://github.com/muxi-ai/onellm" target="_blank"><img src="https://img.shields.io/github/stars/ranaroussi/onellm.svg?style=social&label=Star&maxAge=60" alt="Star this repo"></a>
20
+ > [🌟 Star this repo on GitHub →](https://github.com/muxi-ai/onellm)
47
21
  >
48
22
  > Thank you for your support! 🙏
49
23
 
@@ -74,10 +48,10 @@ Dynamic: requires-python
74
48
 
75
49
  The library follows the OpenAI client API design pattern, making it familiar to developers already using OpenAI and enabling easy migration for existing applications. **Simply change your import statements and instantly gain access to hundreds of models** across dozens of providers while maintaining your existing code structure.
76
50
 
77
- With support for 25+ providers, OneLLM gives you access to approximately 300+ unique language models through a single, consistent interface - from the latest proprietary models to open-source alternatives, all accessible through familiar OpenAI-compatible patterns.
51
+ With support for 18 implemented providers (and more planned), OneLLM gives you access to approximately 300+ unique language models through a single, consistent interface - from the latest proprietary models to open-source alternatives, all accessible through familiar OpenAI-compatible patterns.
78
52
 
79
53
  > [!NOTE]
80
- > **Work in Progress**: OneLLM is currently under active development. The full functionality has been achieved using OpenAI, and I'm now working on adding support for more providers. [Contributions are welcome](./CONTRIBUTING.md) to help expand provider support!
54
+ > **Ready for Use**: OneLLM now supports 18 providers with 300+ models! From cloud APIs to local models, you can access them all through a single, unified interface. [Contributions are welcome](./CONTRIBUTING.md) to help add even more providers!
81
55
 
82
56
  ---
83
57
 
@@ -86,13 +60,25 @@ With support for 25+ providers, OneLLM gives you access to approximately 300+ un
86
60
  ### Installation
87
61
 
88
62
  ```bash
89
- # Basic installation (includes OpenAI compatibility)
63
+ # Basic installation (includes OpenAI compatibility and download utility)
90
64
  pip install OneLLM
91
65
 
92
66
  # For all providers (includes dependencies for future provider support)
93
67
  pip install "OneLLM[all]"
94
68
  ```
95
69
 
70
+ ### Download Models for Local Use
71
+
72
+ OneLLM includes a built-in utility for downloading GGUF models:
73
+
74
+ ```bash
75
+ # Download a model from HuggingFace (saves to ~/llama_models by default)
76
+ onellm download --repo-id "TheBloke/Llama-2-7B-GGUF" --filename "llama-2-7b.Q4_K_M.gguf"
77
+
78
+ # Download to a custom directory
79
+ onellm download -r "microsoft/Phi-3-mini-4k-instruct-gguf" -f "Phi-3-mini-4k-instruct-q4.gguf" -o /path/to/models
80
+ ```
81
+
96
82
  ### Quick Win: Your First LLM Call
97
83
 
98
84
  ```python
@@ -121,13 +107,15 @@ For more detailed examples, check out the [examples directory](./examples).
121
107
  | Feature | Description |
122
108
  |---------|-------------|
123
109
  | **📦 Drop-in replacement** | Use your existing OpenAI code with minimal changes |
124
- | **🔄 Provider-agnostic** | Support for 300+ models across 25+ LLM providers |
110
+ | **🔄 Provider-agnostic** | Support for 300+ models across 18 implemented providers |
125
111
  | **🔁 Automatic fallback** | Seamlessly switch to alternative models when needed |
126
112
  | **🔄 Auto-retry mechanism** | Retry the same model multiple times before failing |
127
113
  | **🧩 OpenAI-compatible** | Familiar interface for developers used to OpenAI |
128
114
  | **📺 Streaming support** | Real-time streaming responses from supported providers |
129
115
  | **🖼️ Multi-modal capabilities** | Support for text, images, audio across compatible models |
130
- | **🖼️ Local LLM support** | Support for local LLMs via Ollama and llama.cpp |
116
+ | **🏠 Local LLM support** | Run models locally via Ollama and llama.cpp |
117
+ | **⬇️ Model downloads** | Built-in CLI to download GGUF models from HuggingFace |
118
+ | **🧹 Unicode artifact cleaning** | Automatic removal of invisible characters to prevent AI detection |
131
119
  | **🏷️ Consistent naming** | Clear `provider/model-name` format for attribution |
132
120
  | **🧪 Comprehensive tests** | 96% test coverage ensuring reliability |
133
121
  | **📄 Apache-2.0 license** | Open-source license that protects contributions |
@@ -136,11 +124,29 @@ For more detailed examples, check out the [examples directory](./examples).
136
124
 
137
125
  ## 🌐 Supported Providers
138
126
 
139
- OneLLM supports models through three main approaches:
140
-
141
- 1. **Direct integration with provider APIs**
142
- 2. **OpenRouter connectivity for aggregated access**
143
- 3. **Local model support via Ollama and llama.cpp**
127
+ OneLLM currently supports **18 providers** with more on the way:
128
+
129
+ ### Cloud API Providers (16)
130
+ - **Anthropic** - Claude family of models
131
+ - **Anyscale** - Configurable AI platform
132
+ - **AWS Bedrock** - Access to multiple model families
133
+ - **Azure OpenAI** - Microsoft-hosted OpenAI models
134
+ - **Cohere** - Command models with RAG
135
+ - **DeepSeek** - Chinese LLM provider
136
+ - **Fireworks** - Fast inference platform
137
+ - **Google AI Studio** - Gemini models via API key
138
+ - **Groq** - Ultra-fast inference for Llama, Mixtral
139
+ - **Mistral** - Mistral Large, Medium, Small
140
+ - **OpenAI** - GPT-4o, 3o-mini, DALL-E, Whisper, etc.
141
+ - **OpenRouter** - Gateway to 100+ models
142
+ - **Perplexity** - Search-augmented models
143
+ - **Together AI** - Open-source model hosting
144
+ - **Vertex AI** - Google Cloud's enterprise Gemini
145
+ - **X.AI** - Grok models
146
+
147
+ ### Local Providers (2)
148
+ - **Ollama** - Run models locally with easy management
149
+ - **llama.cpp** - Direct GGUF model execution
144
150
 
145
151
  ### Notable Models Available
146
152
 
@@ -673,14 +679,29 @@ Models are specified using a provider prefix to clearly identify the source:
673
679
  <td><code>mistral/mistral-large</code></td>
674
680
  </tr>
675
681
  <tr>
676
- <td>Local via Ollama</td>
677
- <td><code>ollama/{model}</code></td>
678
- <td><code>ollama/llama3</code></td>
682
+ <td>Ollama</td>
683
+ <td><code>ollama/{model}@host:port</code></td>
684
+ <td><code>ollama/llama3:8b@localhost:11434</code></td>
685
+ </tr>
686
+ <tr>
687
+ <td>llama.cpp</td>
688
+ <td><code>llama_cpp/{model.gguf}</code></td>
689
+ <td><code>llama_cpp/llama-3-8b-q4_K_M.gguf</code></td>
690
+ </tr>
691
+ <tr>
692
+ <td>XAI (Grok)</td>
693
+ <td><code>xai/{model}</code></td>
694
+ <td><code>xai/grok-beta</code></td>
695
+ </tr>
696
+ <tr>
697
+ <td>Cohere</td>
698
+ <td><code>cohere/{model}</code></td>
699
+ <td><code>cohere/command-r-plus</code></td>
679
700
  </tr>
680
701
  <tr>
681
- <td>Via OpenRouter</td>
682
- <td><code>openrouter/{provider}/{model}</code></td>
683
- <td><code>openrouter/anthropic/claude-3</code></td>
702
+ <td>AWS Bedrock</td>
703
+ <td><code>bedrock/{model}</code></td>
704
+ <td><code>bedrock/claude-3-5-sonnet</code></td>
684
705
  </tr>
685
706
  </table>
686
707
 
@@ -0,0 +1 @@
1
+ 0.1.0