
질문 | 기능 요청
단순화. 하나로 하다. 더욱 상 세히 하다.
| 특징 | autollm | 랭케인 | llamaindex | Litellm |
|---|---|---|---|---|
| 100+ LLM | ✅ | ✅ | ✅ | ✅ |
| 통합 API | ✅ | ✅ | ||
| 20+ 벡터 데이터베이스 | ✅ | ✅ | ✅ | |
| 비용 계산 (100+ LLM) | ✅ | ✅ | ||
| 1 라인 래그 LLM 엔진 | ✅ | |||
| 1 라인 Fastapi | ✅ |
Python> = 3.8 환경에서 PIP와 함께 Autollm 패키지를 쉽게 설치하십시오.
pip install autollm내장 데이터 리더 (Github, PDF, Docx, Ipynb, Epub, Mbox, Websites ..)의 경우 : 설치 :
pip install autollm[readers]비디오 자습서 :
블로그 게시물 :
Colab 노트북 :
>> > from autollm import AutoQueryEngine , read_files_as_documents
>> > documents = read_files_as_documents ( input_dir = "path/to/documents" )
>> > query_engine = AutoQueryEngine . from_defaults ( documents )
>> > response = query_engine . query (
... "Why did SafeVideo AI develop this project?"
... )
>> > response . response
"Because they wanted to deploy rag based llm apis in no time!" >> > from autollm import AutoQueryEngine
>> > query_engine = AutoQueryEngine . from_defaults (
... documents = documents ,
... llm_model = "gpt-3.5-turbo" ,
... llm_max_tokens = "256" ,
... llm_temperature = "0.1" ,
... system_prompt = '...' ,
... query_wrapper_prompt = '...' ,
... enable_cost_calculator = True ,
... embed_model = "huggingface/BAAI/bge-large-zh" ,
... chunk_size = 512 ,
... chunk_overlap = 64 ,
... context_window = 4096 ,
... similarity_top_k = 3 ,
... response_mode = "compact" ,
... structured_answer_filtering = False ,
... vector_store_type = "LanceDBVectorStore" ,
... lancedb_uri = "./lancedb" ,
... lancedb_table_name = "vectors" ,
... exist_ok = True ,
... overwrite_existing = False ,
... )
>> > response = query_engine . query ( "Who is SafeVideo AI?" )
>> > print ( response . response )
"A startup that provides self hosted AI API's for companies!" >> > import uvicorn
>> > from autollm import AutoFastAPI
>> > app = AutoFastAPI . from_query_engine ( query_engine )
>> > uvicorn . run ( app , host = "0.0.0.0" , port = 8000 )
INFO : Started server process [ 12345 ]
INFO : Waiting for application startup .
INFO : Application startup complete .
INFO : Uvicorn running on http : // http : // 0.0 . 0.0 : 8000 / >> > from autollm import AutoFastAPI
>> > app = AutoFastAPI . from_query_engine (
... query_engine ,
... api_title = '...' ,
... api_description = '...' ,
... api_version = '...' ,
... api_term_of_service = '...' ,
)
>> > uvicorn . run ( app , host = "0.0.0.0" , port = 8000 )
INFO : Started server process [ 12345 ]
INFO : Waiting for application startup .
INFO : Application startup complete .
INFO : Uvicorn running on http : // http : // 0.0 . 0.0 : 8000 / >> > from autollm import AutoQueryEngine
>> > os . environ [ "HUGGINGFACE_API_KEY" ] = "huggingface_api_key"
>> > llm_model = "huggingface/WizardLM/WizardCoder-Python-34B-V1.0"
>> > llm_api_base = "https://my-endpoint.huggingface.cloud"
>> > AutoQueryEngine . from_defaults (
... documents = '...' ,
... llm_model = llm_model ,
... llm_api_base = llm_api_base ,
... )Huggingface -Ollama 예 :
>> > from autollm import AutoQueryEngine
>> > llm_model = "ollama/llama2"
>> > llm_api_base = "http://localhost:11434"
>> > AutoQueryEngine . from_defaults (
... documents = '...' ,
... llm_model = llm_model ,
... llm_api_base = llm_api_base ,
... )Microsoft Azure- Openai 예 :
>> > from autollm import AutoQueryEngine
>> > os . environ [ "AZURE_API_KEY" ] = ""
>> > os . environ [ "AZURE_API_BASE" ] = ""
>> > os . environ [ "AZURE_API_VERSION" ] = ""
>> > llm_model = "azure/<your_deployment_name>" )
>> > AutoQueryEngine . from_defaults (
... documents = '...' ,
... llm_model = llm_model
... )Google- vertexai 예 :
>> > from autollm import AutoQueryEngine
>> > os . environ [ "VERTEXAI_PROJECT" ] = "hardy-device-38811" # Your Project ID`
>> > os . environ [ "VERTEXAI_LOCATION" ] = "us-central1" # Your Location
>> > llm_model = "text-bison@001"
>> > AutoQueryEngine . from_defaults (
... documents = '...' ,
... llm_model = llm_model
... )AWS Bedrock -Claude v2 예 :
>> > from autollm import AutoQueryEngine
>> > os . environ [ "AWS_ACCESS_KEY_ID" ] = ""
>> > os . environ [ "AWS_SECRET_ACCESS_KEY" ] = ""
>> > os . environ [ "AWS_REGION_NAME" ] = ""
>> > llm_model = "anthropic.claude-v2"
>> > AutoQueryEngine . from_defaults (
... documents = '...' ,
... llm_model = llm_model
... ) ? 프로 팁 : autollm 벡터 저장소로 lancedb 로 기본적으로 설정합니다. 설정이없고 서버가 없으며 100 배 더 비용 효율적입니다!
>> > from autollm import AutoQueryEngine
>> > import qdrant_client
>> > vector_store_type = "QdrantVectorStore"
>> > client = qdrant_client . QdrantClient (
... url = "http://<host>:<port>" ,
... api_key = "<qdrant-api-key>"
... )
>> > collection_name = "quickstart"
>> > AutoQueryEngine . from_defaults (
... documents = '...' ,
... vector_store_type = vector_store_type ,
... client = client ,
... collection_name = collection_name ,
... ) >> > from autollm import AutoServiceContext
>> > service_context = AutoServiceContext ( enable_cost_calculation = True )
# Example verbose output after query
Embedding Token Usage : 7
LLM Prompt Token Usage : 1482
LLM Completion Token Usage : 47
LLM Total Token Cost : $ 0.002317 >> > from autollm import AutoFastAPI
>> > app = AutoFastAPI . from_config ( config_path , env_path ) 여기에서 config 및 env 구성 및 환경 파일 경로로 대체해야합니다.
FastApi 앱을 만든 후 터미널에서 다음 명령을 실행하여 실행하고 실행하십시오.
uvicorn main:appllama-index에서 전환? 우리는 당신을 덮었습니다.
>> > from llama_index import StorageContext , ServiceContext , VectorStoreIndex
>> > from llama_index . vectorstores import LanceDBVectorStore
>> > from autollm import AutoQueryEngine
>> > vector_store = LanceDBVectorStore ( uri = "./.lancedb" )
>> > storage_context = StorageContext . from_defaults ( vector_store = vector_store )
>> > service_context = ServiceContext . from_defaults ()
>> > index = VectorStoreIndex . from_documents (
documents = documents ,
storage_context = storage_contex ,
service_context = service_context ,
)
>> > query_engine = AutoQueryEngine . from_instances ( index )Q : 상업 프로젝트에 사용할 수 있습니까?
A : 예, Autollm은 GNU Affero General Public License (AGPL 3.0)에 따라 라이센스를 부여하여 특정 조건에서 상업적으로 사용할 수 있습니다. 자세한 내용은 당사에 문의하십시오.
우리의 로드맵은 다가오는 기능과 통합을 설명하여 Autollm을 대형 언어 모델 응용 프로그램을위한 가장 확장적이고 강력한 기본 패키지로 만들 수 있습니다.
1 라인 Gradio 앱 생성 및 배포
예산 기반 이메일 알림
자동화 된 LLM 평가
PDF-Chat, Documentation-Chat, Academic-Paper-Analysis, Patent-Analysis 등에 QuickStart 앱을 추가로 추가하십시오!
Autollm은 GNU Affero General Public License (AGPL 3.0)에 따라 제공됩니다.
자세한 내용, 지원 또는 질문은 다음과 같이 문의하십시오.
Autollm을 사랑합니까? 저장소에 별을별로 표현하거나 공헌하고 우리가 더 나아지게하도록 도와주세요! 자세한 내용은 기고 가이드 라인을 참조하십시오.


