
คำถาม | คำขอคุณสมบัติ
ลดความซับซ้อน รวมกัน ขยาย.
| คุณสมบัติ | autollm | คนขี้เกียจ | llamainedex | Litellm |
|---|---|---|---|---|
| 100+ LLMS | ||||
| API แบบครบวงจร | ||||
| ฐานข้อมูลเวกเตอร์ 20+ | ||||
| การคำนวณต้นทุน (100+ LLMs) | ||||
| เครื่องยนต์ RAG LLM 1 บรรทัด | ||||
| Fastapi 1 บรรทัด |
ติดตั้งแพ็คเกจ Autollm ได้อย่างง่ายดายด้วย PIP ใน Python> = 3.8 สภาพแวดล้อม
pip install autollmสำหรับเครื่องอ่านข้อมูลในตัว (GitHub, PDF, DOCX, IPYNB, EPUB, MBOX, เว็บไซต์ .. ), ติดตั้งด้วย:
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
... ) - เคล็ดลับ PRO : ค่าเริ่มต้น autollm เป็น lancedb เป็นร้านค้า Vector: ไม่มีการตั้งค่าฟรีเซิร์ฟเวอร์และ 100x คุ้มค่ามากขึ้น!
>> > 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:appเปลี่ยนจากดัชนี Llama? เรามีคุณครอบคลุม
>> > 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 )ถาม: ฉันสามารถใช้สิ่งนี้สำหรับโครงการเชิงพาณิชย์ได้หรือไม่?
ตอบ: ใช่ Autollm ได้รับใบอนุญาตภายใต้ใบอนุญาตสาธารณะ GNU Affero ทั่วไป (AGPL 3.0) ซึ่งอนุญาตให้ใช้ในเชิงพาณิชย์ภายใต้เงื่อนไขบางประการ ติดต่อเราสำหรับข้อมูลเพิ่มเติม
แผนงานของเราสรุปคุณสมบัติและการรวมเข้าด้วยกันเพื่อให้ Autollm เป็นแพ็คเกจฐานที่ยืดหยุ่นและทรงพลังที่สุดสำหรับแอปพลิเคชันรุ่นภาษาขนาดใหญ่
การสร้างแอปและการปรับใช้ 1 บรรทัด
การแจ้งเตือนทางอีเมลตามงบประมาณ
การประเมิน LLM อัตโนมัติ
เพิ่มแอพ quickstart เพิ่มเติมเกี่ยวกับ pdf-chat, เอกสารการแชท, การวิเคราะห์กระดาษวิชาการ, การวิเคราะห์สิทธิบัตรและอีกมากมาย!
Autollm สามารถใช้ได้ภายใต้ใบอนุญาตสาธารณะ GNU Affero ทั่วไป (AGPL 3.0)
สำหรับข้อมูลเพิ่มเติมการสนับสนุนหรือคำถามกรุณาติดต่อ:
รัก autollm? แสดง repo หรือมีส่วนร่วมและช่วยให้เราทำให้ดียิ่งขึ้น! ดูแนวทางการสนับสนุนของเราสำหรับข้อมูลเพิ่มเติม


