Create your private AI model with no training data or GPUs 🤖🚀.
Project description
💸 Cut chatbot costs by up to 40% • 📊 No training data needed • 🌱 No GPU needed
Artifex is a Python library that generates small, fast, task-specific AI models that you can run locally — without any training data or GPU required.
It can be used to reduce chatbot costs by up to 40%, by offloading common tasks, especially guardrails, to small models that you can run locally on CPU, instead of relying on expensive API calls.
🔥 Why Artifex?
- 💸 Cut chatbot costs by 40%: Offload chatbot tasks to local models and reduce the number of paid API calls.
- 📊 No training data needed: Uses synthetic data generation under the hood.
- 🌱 No GPU needed: All models are designed to run efficiently on CPU.
- 🔒 Keep ownership of your models: Keep exclusive ownership of the models you generate.
- 🔧 Prebuilt templates for common tasks:
- Guardrail
- Intent Classifier
- More coming soon! Suggest a task or vote one up
🔬 Experiments
Comparison of chatbots relying solely to the OpenAI API vs chatbots that offload guardrail tasks to a local model generated with Artifex have shown that the latter:
- Send up to 66% fewer messages to the OpenAI API
- Are up to 40% cheaper overall
- Have up to 8% lower latency
While maintaining the same level of safety and quality.
🚀 Quick Start
Create a local guardrail model with Artifex and integrate it into your chatbot in 3 simple steps:
1. Install Artifex:
pip install artifex
2. Train a guardrail based on your requirements:
from artifex import Artifex
guardrail = Artifex().guardrail
guardrail.train(
instructions=[
"Soft medical advice is allowed, but it should be general and not specific to any individual.",
"Anything that is about cosmetic products, including available products or their usage, is allowed.",
"Anything else, including hard medical advice, is not allowed under any circumstances.",
]
)
➡️ Model will be saved by default to artifex_output/run-<timestamp>/output_model/
3. Replace your chatbot's guardrail-related API calls with calls to your new local model:
"""
🚫 Instead of calling the OpenAI (or any other) API to check if a message is safe:
"""
# response = openai.ChatCompletion.create(...)
# is_safe = response.choices[0].message.content
"""
✅ Load your local guardrail model (assuming it was generated in the default
'artifex_output/run-<timestamp>/output_model/' directory) and use it instead:
"""
guardrail = Artifex().guardrail
guardrail.load("artifex_output/run-<timestamp>/output_model/")
is_safe = guardrail(user_message)
(Optional) 4. Not satisfied with the model's performance? Is it getting some edge-cases wrong? Just keep training it!
guardrail = Artifex().guardrail
guardrail.load("artifex_output/run-<timestamp>/output_model/")
guardrail.train(
instructions=[
"While soft medical advice is allowed, saying that 'you should take X medication' is not allowed.",
"While discussing cosmetic products is allowed, recommending a competitor's product is not.",
]
)
🧰 Supported Tasks (more coming soon) — suggest one or vote one up
We continue to add new models to Artifex, so stay tuned for updates! Currently, you can generate the following models:
- 🛡️ Chatbot Guardrail: Flags unsafe, harmful, or off-topic messages.
- 🗂️ Intent Classifier: Maps text to intents, such as "product_inquiry", "send_email"...
- 📝 Interested in other models? If there is a specific task you'd like to perform with Artifex, write it in the discussion or vote up any suggestion.
🔗 More Examples & Demos
Guardrail Model
- Tutorial — create a Guardrail Model with Artifex
- Demo — try a Guardrail Model trained with Artifex
- HF page — see a Guardrail Model trained with Artifex
Intent Classifier Model
- Tutorial — create an Intent Classifier Model with Artifex
🔑 Plans
Free plan: each user enjoys 1500 datapoints per month and 500 datapoints per job for free; this is enough to train 3-5 models per month.
Pay-as-you-go: for additional usage beyond the free plan:
- create an account on our platform
- add credits to it
- create an Api Key and pass it to Artifex at instantiation, then use it normally:
from artifex import Artifex guardrail = Artifex(api_key="<your-api-key>").guardrail
The pay-as-you-go pricing is 1$ per 100 datapoints. Once you finish your credits, if you have not exceeded the monthly limit, you will be automatically switched to the free plan.
🤝 Contributing
Contributions are welcome! Whether it's a new task module, improvement, or bug fix — we’d love your help. Not ready to contribute code? You can also help by suggesting a new task or voting up any suggestion.
git clone https://github.com/tanaos/artifex.git
cd artifex
pip install -e .
📚 Documentation & Support
- Full documentation: https://docs.tanaos.com/artifex
- Contact: info@tanaos.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file artifex-0.3.1.tar.gz.
File metadata
- Download URL: artifex-0.3.1.tar.gz
- Upload date:
- Size: 949.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1faa4ecaf28b799ced686d6903e23a813579d1d9f8af58b87f0d5f2da45900bc
|
|
| MD5 |
09e1f139aa9b5da33ad6909fad6ea3f9
|
|
| BLAKE2b-256 |
a596e363cd3689f34fe677da2cf3df74b3bbce4a9085bd475c07421b2474e5b0
|
File details
Details for the file artifex-0.3.1-py3-none-any.whl.
File metadata
- Download URL: artifex-0.3.1-py3-none-any.whl
- Upload date:
- Size: 758.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb3a11f4c39ffc716fde66055ece53928f120a78b72a78b18f765d2865b77f79
|
|
| MD5 |
6171ad55f19a6d55cb32a63482838d6a
|
|
| BLAKE2b-256 |
60b299a263dc1389b020839965c7e3a6e5834c49021a4b7a603ae9aa76fee648
|