# Init LLM
A toolkit for initializing LLMs(Langchain) and embeddings with multiple providers.
All models are openai compatible.
## Installation
```bash
pip install init-llm
```
## Quick Start
```python
from init_llm import ChatLLM, EmbeddingLLM
# Initialize chat model
llm = ChatLLM('openai') # or 'azure', 'anthropic', etc.
response = llm.invoke('Hello!')
# Initialize embeddings
embeddings = EmbeddingLLM('text-embedding-3-small')
vector = embeddings.embed_query('Hello world')
```
## Configuration
The package uses two configuration files:
- `model_providers.toml`: Model configurations and provider settings
- `.env`: API keys and other sensitive information
### Auto Configuration
On first use, the package will:
1. Check for configuration files in the working directory
2. If not found, create them automatically with default settings
3. Load environment variables from `.env`
### Custom Configuration
You can specify custom configuration location and env file name:
```python
llm = ChatLLM(
'openai',
config_dir='/path/to/config',
env_file='custom.env'
)
```
## See Supported Providers in model_providers.toml
## License
[MIT](LICENSE)
Raw data
{
"_id": null,
"home_page": "https://github.com/wangrenyuan/init-llm",
"name": "init-llm",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "llm, ai, langchain, openai, embeddings",
"author": "G",
"author_email": "G <wangrenyuan@outlook.com>",
"download_url": "https://files.pythonhosted.org/packages/08/82/0e61c8934174cd24ae15809ed404660e2dcffb916e26fbd9f308552fe37e/init_llm-0.1.3.tar.gz",
"platform": null,
"description": "# Init LLM\r\n\r\nA toolkit for initializing LLMs(Langchain) and embeddings with multiple providers.\r\nAll models are openai compatible.\r\n\r\n## Installation\r\n\r\n```bash\r\npip install init-llm\r\n```\r\n\r\n## Quick Start\r\n\r\n```python\r\nfrom init_llm import ChatLLM, EmbeddingLLM\r\n\r\n# Initialize chat model\r\nllm = ChatLLM('openai') # or 'azure', 'anthropic', etc.\r\nresponse = llm.invoke('Hello!')\r\n\r\n# Initialize embeddings\r\nembeddings = EmbeddingLLM('text-embedding-3-small')\r\nvector = embeddings.embed_query('Hello world')\r\n```\r\n\r\n## Configuration\r\n\r\nThe package uses two configuration files:\r\n- `model_providers.toml`: Model configurations and provider settings\r\n- `.env`: API keys and other sensitive information\r\n\r\n### Auto Configuration\r\nOn first use, the package will:\r\n1. Check for configuration files in the working directory\r\n2. If not found, create them automatically with default settings\r\n3. Load environment variables from `.env`\r\n\r\n### Custom Configuration\r\nYou can specify custom configuration location and env file name:\r\n\r\n```python\r\nllm = ChatLLM(\r\n 'openai',\r\n config_dir='/path/to/config',\r\n env_file='custom.env'\r\n)\r\n```\r\n\r\n## See Supported Providers in model_providers.toml\r\n\r\n\r\n## License\r\n\r\n[MIT](LICENSE)\r\n\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A toolkit for initializing LLMs and embeddings with multiple providers",
"version": "0.1.3",
"project_urls": {
"Documentation": "https://github.com/bluemeat0724/init_llm#readme",
"Homepage": "https://github.com/bluemeat0724/init_llm",
"Repository": "https://github.com/bluemeat0724/init_llm.git"
},
"split_keywords": [
"llm",
" ai",
" langchain",
" openai",
" embeddings"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1082a2b3befdddc46f50ce3d06efdc264ee6d618e843e43e616381bc81e90864",
"md5": "e5e93ade0ec46a6ec43c089e77e0b1aa",
"sha256": "62fe220f2ef0e5e216ecb10ade92c4bb2a196285858eae83210d40ad7348c3d2"
},
"downloads": -1,
"filename": "init_llm-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e5e93ade0ec46a6ec43c089e77e0b1aa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 7478,
"upload_time": "2024-12-17T04:52:29",
"upload_time_iso_8601": "2024-12-17T04:52:29.509133Z",
"url": "https://files.pythonhosted.org/packages/10/82/a2b3befdddc46f50ce3d06efdc264ee6d618e843e43e616381bc81e90864/init_llm-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "08820e61c8934174cd24ae15809ed404660e2dcffb916e26fbd9f308552fe37e",
"md5": "23f808075d29ecc83ad31da258659f24",
"sha256": "1b3e3203a4f09e7093d1685dcc7167737b41389aa1ea8890dfa6b5a4c1cd5a55"
},
"downloads": -1,
"filename": "init_llm-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "23f808075d29ecc83ad31da258659f24",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 6632,
"upload_time": "2024-12-17T04:52:31",
"upload_time_iso_8601": "2024-12-17T04:52:31.822509Z",
"url": "https://files.pythonhosted.org/packages/08/82/0e61c8934174cd24ae15809ed404660e2dcffb916e26fbd9f308552fe37e/init_llm-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-17 04:52:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "wangrenyuan",
"github_project": "init-llm",
"github_not_found": true,
"lcname": "init-llm"
}