llama-index multi-modal-llms openai-like integration
Project description
LlamaIndex Llms Integration: Openai Like
Overview
This package is a thin wrapper around the OpenAI API. It is designed to be used with the OpenAI API, but can be used with any OpenAI-compatible API into multimodal language models of the LlamaIndex framework.
Installation
pip install llama-index-multi-modal-llms-openai-like
Usage
Initialization
from llama_index.multi_modal_llms.openai_like import OpenAILikeMultiModal
llm = OpenAILikeMultiModal(
model="Qwen/Qwen2-VL-72B-Instruct-base",
api_base="http://localhost:1234/v1",
)
Without environmental variables
from llama_index.multi_modal_llms.openai_like import OpenAILikeMultiModal
llm = OpenAILikeMultiModal(
api_key="your_api_key",
model="Qwen/Qwen2-VL-72B-Instruct-base",
api_base="http://localhost:1234/v1",
)
Launching
Load images
from llama_index.core.multi_modal_llms.generic_utils import load_image_urls
image_urls = [
"https://res.cloudinary.com/hello-tickets/image/upload/c_limit,f_auto,q_auto,w_1920/v1640835927/o3pfl41q7m5bj8jardk0.jpg",
]
image_documents = load_image_urls(image_urls)
Call complete with a prompt
complete_response = mm_llm.complete(
prompt="Describe the images as an alternative text",
image_documents=image_documents,
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_multi_modal_llms_openai_like-0.1.2.tar.gz.
File metadata
- Download URL: llama_index_multi_modal_llms_openai_like-0.1.2.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7dd0dbf3f81b98b412dfecb100ff26389ea3fe25c8f9419cb1f257bc18666ca0
|
|
| MD5 |
b0b78dab186cd823f074bf625b9042f9
|
|
| BLAKE2b-256 |
2aaccdb0b6ae81f39a68f41a8a4a99904b0fdce5290ee7be2b26b0e0b0fc86ba
|
File details
Details for the file llama_index_multi_modal_llms_openai_like-0.1.2-py3-none-any.whl.
File metadata
- Download URL: llama_index_multi_modal_llms_openai_like-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fdb9fe03485ed635fb3239e68ca185d54d3c5d0370545ded31d8846fa9ad2c1
|
|
| MD5 |
332ca0df1ac7aba7a3a095bd2408df02
|
|
| BLAKE2b-256 |
77bb464c549feb94f93635228634cfb50887578ac9ba73b2a7fff07986d2c125
|