콘텐츠로 이동

Self-hosting

Schift 에이전트는 모든 OpenAI 호환 LLM 엔드포인트에 연결할 수 있습니다. 개발 시 로컬 모델을 사용하거나 프로덕션에서 자체 호스팅 모델을 사용할 수 있습니다.

Terminal window
# Ollama 설치
curl -fsSL https://ollama.ai/install.sh | sh
# 모델 다운로드
ollama pull llama3
const agent = new Agent({
name: "Local Agent",
instructions: "You are a helpful assistant.",
model: "llama3",
baseUrl: "http://localhost:11434/v1",
});
const result = await agent.run("Hello!");

API 키가 필요 없습니다. Ollama는 로컬에서 실행됩니다.

Terminal window
# vLLM 서버 시작
python -m vllm.entrypoints.openai.api_server \
--model mistralai/Mistral-7B-Instruct-v0.3 \
--port 8000
const agent = new Agent({
name: "vLLM Agent",
instructions: "You are a helpful assistant.",
model: "mistralai/Mistral-7B-Instruct-v0.3",
baseUrl: "http://127.0.0.1:8002/v1",
});

LiteLLM은 100개 이상의 LLM 제공자를 위한 OpenAI 호환 프록시를 제공합니다.

Terminal window
litellm --model ollama/llama3 --port 4000
const agent = new Agent({
name: "LiteLLM Agent",
instructions: "You are a helpful assistant.",
model: "ollama/llama3",
baseUrl: "http://localhost:4000/v1",
});

Schift Cloud 라우팅 없이 클라우드 제공자에 직접 연결합니다:

const agent = new Agent({
name: "OpenAI Direct",
instructions: "...",
model: "gpt-4o-mini",
baseUrl: "https://api.openai.com/v1",
apiKey: process.env.OPENAI_API_KEY,
});

Anthropic API는 OpenAI 호환이 아닙니다. LiteLLM을 프록시로 사용하세요:

Terminal window
litellm --model anthropic/claude-sonnet-4-6 --port 4000
const agent = new Agent({
model: "anthropic/claude-sonnet-4-6",
baseUrl: "http://localhost:4000/v1",
});

자체 호스팅 LLM을 에이전트에 사용하면서 RAG는 Schift Cloud를 사용할 수 있습니다:

const schift = new Schift({ apiKey: "sch_..." });
const rag = new RAG({ bucket: "docs" }, schift.transport);
const agent = new Agent({
name: "Hybrid Agent",
instructions: "...",
rag, // RAG는 Schift Cloud 경유
model: "llama3", // LLM은 Ollama 경유
baseUrl: "http://localhost:11434/v1",
});