Files

157 lines
3.8 KiB
JSON

[
[
{
"a": "Integrations",
"href": "/integrations"
},
{
"h1": "Use Hanzo AI with Haystack"
},
{
"p": "Build NLP pipelines and RAG systems with Haystack. Point OpenAIChatGenerator at api.hanzo.ai/v1, name a Hanzo model, and the pipeline runs unchanged."
},
{
"p": "Base URL: https://api.hanzo.ai/v1"
},
{
"code": "https://api.hanzo.ai/v1"
},
{
"p": "API Key: Get yours at platform.hanzo.ai/api-keys · Fully OpenAI-compatible · every model on the gateway available"
},
{
"a": "platform.hanzo.ai/api-keys",
"href": "https://platform.hanzo.ai/api-keys"
},
{
"p": "Created by deepset.ai"
},
{
"a": "deepset.ai",
"href": "https://haystack.deepset.ai"
},
{
"p": "License: Apache-2.0 · View source on GitHub →"
},
{
"a": "View source on GitHub →",
"href": "https://github.com/deepset-ai/haystack"
},
{
"p": "Hanzo AI is OpenAI-compatible, so existing Haystack code works with zero refactoring. We deeply appreciate the deepset.ai team for building and maintaining this open-source project."
},
{
"h2": "Haystack + Hanzo"
},
{
"code": "pip install haystack-ai from haystack . components . generators . chat import OpenAIChatGenerator from haystack . dataclasses import ChatMessage from haystack . utils import Secret generator = OpenAIChatGenerator ( model= \" zen4-pro \" , api_key=Secret . from_token ( \" your-hanzo-api-key \" ), api_base_url= \" https://api.hanzo.ai/v1 \" , ) messages = [ ChatMessage . from_user ( \" What is RAG? \" )] result = generator . run ( messages=messages )"
},
{
"h2": "RAG pipeline"
},
{
"code": "from haystack import Pipeline from haystack . components . builders import PromptBuilder from haystack . components . generators . chat import OpenAIChatGenerator prompt_template = \"\"\" Context: {% for doc in documents %}{{ doc.content }}{% endfor %} Question: {{ question }} Answer: \"\"\" pipeline = Pipeline () pipeline . add_component ( \" prompt \" , PromptBuilder ( template=prompt_template )) pipeline . add_component ( \" llm \" , OpenAIChatGenerator ( model= \" zen4-pro \" , api_key=Secret . from_token ( \" your-hanzo-api-key \" ), api_base_url= \" https://api.hanzo.ai/v1 \" , ))"
},
{
"h2": "Embeddings"
},
{
"code": "from haystack . components . embedders import OpenAITextEmbedder embedder = OpenAITextEmbedder ( model= \" openai/text-embedding-3-large \" , api_key=Secret . from_token ( \" your-hanzo-api-key \" ), api_base_url= \" https://api.hanzo.ai/v1 \" , )"
},
{
"h2": "Install"
},
{
"code": "pip install haystack-ai export HANZO_API_KEY= \" your-hanzo-api-key \""
},
{
"h2": "Ready to get started?"
},
{
"p": "Create a free account and get your API key. The Free plan includes free model requests and Kai decisions, no card."
},
{
"a": "Get API key — Free",
"href": "https://platform.hanzo.ai/api-keys"
},
{
"a": "Browse Models",
"href": "/models"
},
{
"h2": "More integrations"
},
{
"a": "OpenAI Python SDK",
"href": "/integrations/openai-sdk"
},
{
"a": "Anthropic SDK",
"href": "/integrations/anthropic-sdk"
},
{
"a": "LangChain",
"href": "/integrations/langchain"
},
{
"a": "LlamaIndex",
"href": "/integrations/llamaindex"
},
{
"a": "Vercel AI SDK",
"href": "/integrations/vercel-ai-sdk"
},
{
"a": "Hugging Face",
"href": "/integrations/huggingface"
},
{
"a": "AutoGen",
"href": "/integrations/autogen"
},
{
"a": "CrewAI",
"href": "/integrations/crewai"
},
{
"a": "DSPy",
"href": "/integrations/dspy"
},
{
"a": "Cursor",
"href": "/integrations/cursor"
},
{
"a": "Continue.dev",
"href": "/integrations/continue-dev"
},
{
"a": "GitHub Copilot",
"href": "/integrations/github-copilot"
},
{
"a": "Docker",
"href": "/integrations/docker"
},
{
"a": "Kubernetes",
"href": "/integrations/kubernetes"
},
{
"a": "Python",
"href": "/integrations/python"
},
{
"a": "TypeScript",
"href": "/integrations/typescript"
},
{
"a": "Go",
"href": "/integrations/go"
},
{
"a": "Rust",
"href": "/integrations/rust"
}
]
]