Skip to main content

Create your private AI model with no training data or GPUs 🤖🚀.

Project description

Artifex - Train small, private AI models without data

Artifex - Train small, private AI models without data

Documentation · Tutorial

Latest PyPi package version Tests status Sample Models on HuggingFace GitHub commit activity Artifex Documentation

💸 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 (e.g. intent classifiers, guardrails, text-to-SQL converters...) that you can run locallywithout 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 APIs.

🔥 Features

  • 💸 Cut chatbot costs by 40%: Offload chatbot tasks to local models and reduce the number of paid API calls.
  • 📊 No training data needed: Uses smart prompting and synthetic 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:

🚀 Quick Start

Install with pip:

pip install artifex
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.",
    ]
)

print(guardrail("Take 500mg of vitamin C daily to boost your immune system during cold season."))
# ➜ "unsafe"

🧰 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"...
  • 📝 Got Suggestions? If there is a specific task you'd like to perform with Artifex, write it in the discussion or vote up any suggestion

🧪 Examples

🛡️ Guardrail Example — try the tutorial:

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.",
    ]
)

# Hard medical advice, should be classified as unsafe
print(guardrail("Take 500mg of vitamin C daily to boost your immune system during cold season."))
# ➜ "unsafe"

# Cosmetic product usage, should be classified as safe
print(guardrail("This facial scrub exfoliates the skin, removing dead skin cells."))
# ➜ "safe"

🗂️ Intent Classifier Example — try the tutorial:

from artifex import Artifex

intent_classifier = Artifex().intent_classifier

intent_classifier.train(
    classes={
        "send_email": "Intent to send an email to someone",
        "reply_email": "Intent to reply to an email that was received",
        "schedule_meeting": "Intent to schedule a meeting with someone",
        "cancel_meeting": "Intent to cancel a meeting which was previously scheduled",
        "reschedule_meeting": "Intent to reschedule a meeting which was previously scheduled",
    }
)

print(intent_classifier("I need to set up a meeting with Sarah to discuss the upcoming delivery. Can you help me do that?"))
# ➜ "schedule_meeting"

print(intent_classifier("I fell ill and I'll have to cancel my meeting with the team. Please go ahead and do it for me."))
# ➜ "cancel_meeting"

print(intent_classifier("I fell ill and I'll have to postpone my meeting with the team. Please go ahead and do it for me."))
# ➜ "reschedule_meeting"

🧩 Plug-and-Play Deployment

  • Integrate with FastAPI, Flask, Streamlit, or Gradio
  • No external dependencies on OpenAI or GPU runtimes

🤝 Contributing

Contributions 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 .

🔗 Tutorials & Demos

Guardrail Model

  1. Tutorial — create a Guardrail Model with Artifex
  2. Demo — try a Guardrail Model trained with Artifex
  3. HF page — see a Guardrail Model trained with Artifex

Intent Classifier Model

  1. Tutorial — create an Intent Classifier Model with Artifex

📚 Documentation & Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

artifex-0.3.0.tar.gz (914.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

artifex-0.3.0-py3-none-any.whl (723.7 kB view details)

Uploaded Python 3

File details

Details for the file artifex-0.3.0.tar.gz.

File metadata

  • Download URL: artifex-0.3.0.tar.gz
  • Upload date:
  • Size: 914.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for artifex-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2848df55ec5ae453a4ac42dd1d0b3bd983ecef88b1ef84da4e701aa9bb982263
MD5 7aa4ca76c2803caa8963a700261faa58
BLAKE2b-256 cbd968f227e290b7451260ab52ea99b7f8d6aff22a674882db3cdfb25cd02100

See more details on using hashes here.

File details

Details for the file artifex-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: artifex-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 723.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for artifex-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c20deed29f4287879c9c961e7d5a9c4c2e04db584c2f15e96974f53ae39843e
MD5 2506f523b1d1bbb66f802d4326ae30e4
BLAKE2b-256 5338b8e28965b3bc9c65173b49b0b584b106d11a965bf6cf41ddc6ae6bad312a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page