Skip to content
/ l1m Public

The easiest way to get structured data from unstructured text or images using LLMs. No prompt engineering, no chat history, just a simple API to extract structured JSON from text or images.

License

Notifications You must be signed in to change notification settings

l1m-io/l1m

Folders and files

NameName
Last commit message
Last commit date
Feb 27, 2025
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025
Mar 5, 2025
Mar 2, 2025
Feb 28, 2025
Feb 26, 2025
Feb 26, 2025
Apr 13, 2025
Feb 27, 2025

Repository files navigation

l1m πŸš€

License Homepage Go Reference npm PyPI

A Proxy to extract structured data from text and images using LLMs.

🌟 Why l1m?

l1m is the easiest way to get structured data from unstructured text or images using LLMs. No prompt engineering, no chat history, just a simple API to extract structured JSON from text or images.

✨ Features

  • πŸ“‹ Simple Schema-First Approach: Define your data structure in JSON Schema, get back exactly what you need
  • 🎯 Zero Prompt Engineering: No need to craft complex prompts or chain multiple calls. Add context as JSON schema descriptions
  • πŸ”„ Provider Flexibility: Bring your own provider, supports any OpenAI compatible or Anthropic provider and Anthropic models
  • ⚑ Caching: Built-in caching, with x-cache-ttl (seconds) header to use l1m.io as a cache for your LLM requests
  • πŸ”“ Open Source: Open-source, no vendor lock-in. Or use the hosted version with free-tier and high availability
  • πŸ”’ Privacy First: We don't store your data, unless you use the x-cache-ttl header
  • ⚑️ Works Locally: Use l1m locally with Ollama or any other OpenAI compatible model provider

πŸš€ Quick Start

Text Example

curl -X POST https://api.l1m.io/structured \
-H "Content-Type: application/json" \
-H "X-Provider-Url: demo" \
-H "X-Provider-Key: demo" \
-H "X-Provider-Model: demo" \
-d '{
  "input": "A particularly severe crisis in 1907 led Congress to enact the Federal Reserve Act in 1913",
  "schema": {
    "type": "object",
    "properties": {
      "items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": { "type": "string" },
            "price": { "type": "number" }
          }
        }
      }
    }
  }
}'

Image Example

curl -X POST https://api.l1m.io/structured \
-H "Content-Type: application/json" \
-H "X-Provider-Url: demo" \
-H "X-Provider-Key: demo" \
-H "X-Provider-Model: demo" \
-d '{
  "input": "'$(curl -s https://public.l1m.io/menu.jpg | base64)'",
  "schema": {
    "type": "object",
    "properties": {
      "items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": { "type": "string" },
            "price": { "type": "number" }
          }
        }
      }
    }
  }
}'

Node.js Example

See sdk-node for a complete example.

Python Example

See sdk-python for a complete example.

Go Example

See sdk-go for a complete example.

πŸ“š Documentation

API Headers

  • x-provider-model (optional): Custom LLM model to use
  • x-provider-url (optional): Custom LLM provider URL (OpenAI compatible or Anthropic API)
  • x-provider-key (optional): API key for custom LLM provider
  • x-cache-ttl (optional): Cache TTL in seconds
    • Cache key (generated) = hash(input + schema + x-provider-key + x-provider-model)

Supported Image Formats

  • image/jpeg
  • image/png

πŸ› οΈ SDKs

Official SDKs are available for:

⚑️ Running Locally

See local.md for instructions on running l1m locally (and using with Ollama).

πŸ”” Stay Updated

Join our waitlist to get early access to the production release of our hosted version.

πŸ“š Acknowledgements

🏒 About

Built by Inferable.

About

The easiest way to get structured data from unstructured text or images using LLMs. No prompt engineering, no chat history, just a simple API to extract structured JSON from text or images.

Topics

Resources

License

Stars

Watchers

Forks