vectorspacelab/arex-skill/api-and-deployment
Claude Code and agent skill by vectorspacelab/arex-skill
- community
Checking that the SKILL.md file is still in the repository.
"Configure and deploy txtai Application/API services,
Install
npx vskill@latest install vectorspacelab/arex-skill/api-and-deploymentSKILL.md
The same SKILL.md was published earlier as vectorspacelab/arex-skill/api-and-deployment.
API and Deployment
Use this sub-skill when the user wants to run txtai as a configured application, FastAPI service, OpenAI-compatible endpoint, MCP server, secured internal service, custom API, distributed embeddings cluster, container/cloud deployment, or console-driven index explorer.
Route away from this sub-skill when the user is asking for detailed index/query authoring, pipeline design, or agent prompting internals:
- Use
../embeddings-search/SKILL.mdforEmbeddingsindexing, SQL, hybrid, graph, object, and search-query design. - Use
../pipelines-and-workflows/SKILL.mdfor pipeline selection, workflow task authoring, scheduling, and generator consumption. - Use
../agents-and-llm-orchestration/SKILL.mdfor LLM, RAG, Agent tools, prompts, templates, and model backend behavior.
Fast Path
- Install API support in the target environment.
``bash pip install "txtai[api]" ``
- Generate a safe starter config without launching a server.
``bash python skills/txtai/sub-skills/api-and-deployment/scripts/api_config_template.py \ --template secure-readonly --output app.yml python skills/txtai/sub-skills/api-and-deployment/scripts/api_config_template.py --validate app.yml ``
- Start FastAPI/Uvicorn from the directory that contains
app.yml.
``bash CONFIG=app.yml uvicorn "txtai.api:app" --host 127.0.0.1 --port 8000 ``
- Inspect live route docs at
http://127.0.0.1:8000/docsand smoke-test a route enabled by the config.
``bash curl "http://127.0.0.1:8000/count" ``
Configuration Model
The API is backed by Application(config, loaddata=True). The config can be a YAML file path, YAML string, or dict. When loaddata=True, a saved index at top-level path is loaded if it exists; otherwise models/components are constructed from config.
Core top-level YAML keys:
path: saved embeddings index path for API load/save; one API process serves one primary index path.writable:falseby default; required for/add,/index,/upsert,/delete, and/reindex.reindex:falseby default; only enable for trusted admin clients because/reindexaccepts new config.embeddings: creates/loads an embeddings index and enables embeddings/search routes.- Pipeline keys such as
summary,labels,textractor,llm,rag,translation: create matching pipeline instances and routes. workflow: defines named workflows and enables/workflow.agent: defines named agents and enables/agent.openai:trueenables/v1/...OpenAI-compatible routes.mcp:trueor a dict enables/mcpand exports enabled API routes as MCP tools.cluster: configures an API aggregator over shard URLs.
See references/configuration-and-routes.md for route families, request shapes, response formats, auth, MCP, custom endpoint hooks, and Application details.
Safe Service Patterns
Prefer a two-process or two-config deployment for mutable indexes:
- Admin/build process: private network,
writable: true, optional/addand/index, no public ingress. - Public query service:
writable: false,reindex: false, token auth, TLS at a reverse proxy, only route keys needed by clients. - Treat
/reindexas a trust boundary even when token auth is enabled; it accepts config and optional function names. - Keep model and index caches on persistent volumes in containers/serverless to avoid repeated downloads and cold starts.
Token auth uses a SHA-256 digest in TOKEN, while clients send the raw token in the Authorization header:
For TLS, prefer a reverse proxy terminating HTTPS and forwarding to a loopback/internal Uvicorn service.
See references/deployment.md for Uvicorn, Docker, model caching, cloud/serverless, Kubernetes/Knative, clustering, and observability patterns.
Route Activation Rules
Routes are included based on top-level config keys. If a key is absent, the corresponding route family is absent even though txtai is installed.
Common route groups:
embeddings:GET /search,POST /batchsearch,POST /add,GET /index,GET /upsert,POST /delete,POST /reindex,GET /count, transform/explain/object routes.workflow:POST /workflowwithnameandelements.agent:POST /agentwithname,text, optionalmaxlength, and optionalstream.llmandrag:/llm,/batchllm,/rag,/batchragwhen those pipeline keys are configured.- Pipeline keys: route families such as
/summary,/label,/translate,/textract,/segment,/caption,/tabular,/rerank, and batch variants. openai:/v1/chat/completions,/v1/embeddings,/v1/audio/speech,/v1/audio/transcriptions,/v1/audio/translations.mcp:/mcpmounted by FastApiMCP when configured.
embeddings also enables similarity routes if no separate similarity key is present. cluster without embeddings still includes embeddings routes for the aggregator.
OpenAI-Compatible Use
Set openai: true to expose OpenAI-style routes. The actual backend still comes from txtai config:
- Chat
modelmatching anagentname calls that agent. - Chat
model: embeddingssearches the embeddings index and returns the best result text. - Chat
modelmatching a pipeline name calls that pipeline, exceptllmuses the default LLM pipeline path. - Chat
modelmatching a workflow name runs the named workflow on the first user message. /v1/embeddingsuses the configured embeddings transformer; themodelfield is echoed in the response.
If an OpenAI client reports a missing model or route, check both openai: true and the backing agent, workflow, llm, rag, embeddings, or pipeline section.
MCP, Custom Endpoints, and Auth
Use mcp: true for defaults or a dict with clientargs and mcpargs. MCP exposes enabled API endpoints as tools at /mcp; it does not design tools or prompts for you.
Use environment hooks for advanced service customization:
API_CLASS=package.module.CustomAPIuses a subclass/factory target instead of the default API class.DEPENDENCIES=package.module.Dependencyadds FastAPI dependencies such as custom auth or middleware.EXTENSIONS=package.module.Extensionruns extension hooks that can include custom routers.
Keep extension modules importable from the service environment and avoid referencing local checkout-only paths.
Console Caveat
The console is an index/application explorer, not a standard argparse CLI. python -m txtai.console --help treats --help as the initial index/config path and may fail trying to load it. Use the console with a saved index path or YAML config path:
Inside the console, commands include .load, .config, .limit, .highlight, and .workflow; plain text runs a search query.
Validation Checklist
Before handing an API deployment back to a user, verify:
- Config parses as YAML and expected top-level route keys are present.
- API extras are installed;
from txtai.api import appsucceeds. CONFIGpoints to the intended config file from the service working directory.- Public configs keep
writable: falseandreindex: falseunless explicitly trusted. - Token auth uses a SHA-256 digest in
TOKENand raw bearer token in client requests. /docsshows the expected route families; missing routes usually mean missing config keys.Accept: application/msgpackclients unpack MessagePack; JSON clients handle base64 for bytes/images.- Container/cloud deployments mount index/model caches and satisfy CPU/GPU/system-library requirements.
Use references/troubleshooting.md for symptom-driven fixes covering extras, config paths, auth, OpenAI model routing, MCP dependencies, serialization, clusters, console path semantics, and cloud caveats.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/repositories/repo-skills/txtai/sub-skills/api-and-deployment/SKILL.md
Popularity
- Repository stars
- 324
- Repository forks
- 25
- 7-day trend score
- 29
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/vectorspacelab/arex-skill/api-and-deployment)